grr/core/grr_response_core/stats/stats_utils.py
def Decorated(*args, **kwargs):
      """Calls a decorated function, timing how long it takes."""
      start_time = time.time()
      try:
        return func(*args, **kwargs)
      finally:
        total_time = time.time() - start_time
        stats_collector_instance.Get().RecordEvent(
            self._metric_name, total_time, fields=self._fields)
Calls a decorated function, timing how long it takes.
Calls a decorated function, timing how long it takes.
Calls a decorated function timing how long it takes .
def Decorated(*args, **kwargs):
      start_time = time.time()
      try:
        return func(*args, **kwargs)
      finally:
        total_time = time.time() - start_time
        stats_collector_instance.Get().RecordEvent(
            self._metric_name, total_time, fields=self._fields)
def Decorated ( * args , ** kwargs ) : start_time = time . time ( ) try : return func ( * args , ** kwargs ) finally : total_time = time . time ( ) - start_time stats_collector_instance . Get ( ) . RecordEvent ( self . _metric_name , total_time , fields = self . _fields )
Calls a decorated function, timing how long it takes.
Calls a decorated function timing how long it takes .
"""Calls a decorated function, timing how long it takes."""