Skip to content

Commit ee4c14d

Browse files
author
root
committed
#69 fix the metric grouping num value
1 parent b0aba7a commit ee4c14d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

basescript/log.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,10 @@ def metrics_grouping_processor(logger_class, log_method, event):
323323
for fk, fv in fields:
324324
favg = sfields.get(fk, 0.0)
325325
favg = (favg * num + fv) / (num + 1) #moving average
326-
state['num'] += 1
327326
sfields[fk] = favg
328327

328+
state['num'] += 1
329+
329330
METRICS_STATE[key] = state
330331
finally:
331332
METRICS_STATE_LOCK.release()

0 commit comments

Comments
 (0)