Skip to content

Commit f863e2d

Browse files
committed
try to debug integration tests
1 parent e3a77a6 commit f863e2d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

elasticapm/metrics/base_metrics.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ class Timer(BaseMetric):
398398
__slots__ = BaseMetric.__slots__ + ("_val", "_count", "_lock", "_unit")
399399

400400
def __init__(self, name=None, reset_on_collect=False, unit=None):
401-
self._val = timedelta(seconds=0)
402-
self._count = 0
401+
self._val: timedelta = timedelta(seconds=0)
402+
self._count: int = 0
403403
self._unit = unit
404404
self._lock = threading.Lock()
405405
super(Timer, self).__init__(name, reset_on_collect=reset_on_collect)
@@ -411,7 +411,7 @@ def update(self, duration, count=1):
411411

412412
def reset(self):
413413
with self._lock:
414-
self._val = 0
414+
self._val = timedelta(seconds=0)
415415
self._count = 0
416416

417417
@property
@@ -422,6 +422,8 @@ def val(self):
422422
@val.setter
423423
def val(self, value):
424424
with self._lock:
425+
val, count = value
426+
assert isinstance(val, timedelta)
425427
self._val, self._count = value
426428

427429

0 commit comments

Comments
 (0)