def __call__(self, func):
            # Default to the function name if metric was not provided.
            if not self.metric:
                self.metric = '%s.%s' % (func.__module__, func.__name__)

            @wraps(func)
            def wrapped(*args, **kwargs):
                start = time()
                try:
                    return func(*args, **kwargs)
                finally:
                    self._send(start)
            return wrapped
Decorator which returns the elapsed time of the function call.
dataset/ETHPy150Open DataDog/datadogpy/datadog/dogstatsd/base.py/DogStatsd._TimedContextManagerDecorator.__call__