update metrics.time decorator
@@ -21,15 +21,10 @@ from __future__ import print_function
from prometheus_client import Summary
-def time(name=None, documentation=None):
- summary = Summary(name, documentation)
+def time(*args, **kwargs):
+ summary = Summary(*args, **kwargs)
def time_decorator(f):
-
- def wrapped(*args, **kwargs):
- with summary.time():
- return f(*args, **kwargs)
-
- return wrapped
+ return summary.time()(f)
return time_decorator
