python-gatekeeper/helpers.py
def timer(wrapped_function):
    """
    Decorator which adds the execution time of wrapped functions as a 
    field on the Honeycomb event.
    """
    def wrapper(*args, **kwargs):
        time_start = time.time()

        result = wrapped_function(*args, **kwargs)

        time_end = time.time()
        event_field_name = "timer.%s_dur_ms" % wrapped_function.__name__
        beeline.add_field(event_field_name, (time_end - time_start) * 1000)
        return result

    return wrapper

    Decorator which adds the execution time of wrapped functions as a 
    field on the Honeycomb event.
    
Decorator which adds the execution time of wrapped functions as a
field on the Honeycomb event.
Decorator which adds the execution time of wrapped functions as a field on the Honeycomb event .
def timer(wrapped_function):
    def wrapper(*args, **kwargs):
        time_start = time.time()
        result = wrapped_function(*args, **kwargs)
        time_end = time.time()
        event_field_name = "timer.%s_dur_ms" % wrapped_function.__name__
        beeline.add_field(event_field_name, (time_end - time_start) * 1000)
        return result
    return wrapper
def timer ( wrapped_function ) : def wrapper ( * args , ** kwargs ) : time_start = time . time ( ) result = wrapped_function ( * args , ** kwargs ) time_end = time . time ( ) event_field_name = "timer.%s_dur_ms" % wrapped_function . __name__ beeline . add_field ( event_field_name , ( time_end - time_start ) * 1000 ) return result return wrapper
Decorator which adds the execution time of wrapped functions as a
field on the Honeycomb event.
Decorator which adds the execution time of wrapped functions as a field on the Honeycomb event .
"""
    Decorator which adds the execution time of wrapped functions as a 
    field on the Honeycomb event.
    """
wrapped_function