added errors key to metrics tracking

This commit is contained in:
Lex Berezhny 2019-07-16 13:39:17 -04:00
parent dd9bf04e35
commit 8e64b1840d

View file

@ -91,7 +91,9 @@ def measure(func):
state = ctx.get() state = ctx.get()
if not state.is_tracking_metrics: if not state.is_tracking_metrics:
return func(*args, **kwargs) return func(*args, **kwargs)
metric = state.metrics.setdefault(func.__name__, {'calls': 0, 'total': 0, 'isolated': 0}) metric = state.metrics.setdefault(func.__name__, {
'calls': 0, 'total': 0, 'isolated': 0, 'errors': 0
})
state.stack.append([]) state.stack.append([])
start = time.perf_counter() start = time.perf_counter()
try: try: