|
1 | 1 | import os |
| 2 | +from threading import Lock |
2 | 3 | import time |
3 | 4 | import types |
4 | 5 | from typing import ( |
|
12 | 13 | from .metrics_core import Metric |
13 | 14 | from .registry import Collector, CollectorRegistry, REGISTRY |
14 | 15 | from .samples import Exemplar, Sample |
15 | | -from .utils import floatToGoString, INF, WarnLock |
| 16 | +from .utils import floatToGoString, INF |
16 | 17 | from .validation import ( |
17 | 18 | _validate_exemplar, _validate_labelnames, _validate_metric_name, |
18 | 19 | ) |
@@ -119,7 +120,7 @@ def __init__(self: T, |
119 | 120 |
|
120 | 121 | if self._is_parent(): |
121 | 122 | # Prepare the fields needed for child metrics. |
122 | | - self._lock = WarnLock() |
| 123 | + self._lock = Lock() |
123 | 124 | self._metrics: Dict[Sequence[str], T] = {} |
124 | 125 |
|
125 | 126 | if self._is_observable(): |
@@ -672,7 +673,7 @@ class Info(MetricWrapperBase): |
672 | 673 |
|
673 | 674 | def _metric_init(self): |
674 | 675 | self._labelname_set = set(self._labelnames) |
675 | | - self._lock = WarnLock() |
| 676 | + self._lock = Lock() |
676 | 677 | self._value = {} |
677 | 678 |
|
678 | 679 | def info(self, val: Dict[str, str]) -> None: |
@@ -734,7 +735,7 @@ def __init__(self, |
734 | 735 |
|
735 | 736 | def _metric_init(self) -> None: |
736 | 737 | self._value = 0 |
737 | | - self._lock = WarnLock() |
| 738 | + self._lock = Lock() |
738 | 739 |
|
739 | 740 | def state(self, state: str) -> None: |
740 | 741 | """Set enum metric state.""" |
|
0 commit comments