diff options
| author | robot-piglet <[email protected]> | 2025-02-24 19:06:27 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2025-02-24 19:25:54 +0300 |
| commit | cc1540c72837350cff1b97ae8f6556088946e45d (patch) | |
| tree | 4d5ece470c72b304ec1a7b29dfb0f0a6aea07c15 /library/python/monlib/ut | |
| parent | b08a0cb057c1a81570f638038a0210dc167fa217 (diff) | |
Intermediate changes
commit_hash:175403568527edd57aee48e05da080129d67f6de
Diffstat (limited to 'library/python/monlib/ut')
| -rw-r--r-- | library/python/monlib/ut/py2/test.py | 10 | ||||
| -rw-r--r-- | library/python/monlib/ut/py3/test.py | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/library/python/monlib/ut/py2/test.py b/library/python/monlib/ut/py2/test.py index 4e389c47f17..0289168f049 100644 --- a/library/python/monlib/ut/py2/test.py +++ b/library/python/monlib/ut/py2/test.py @@ -252,6 +252,16 @@ def test_gauge_sensors(): assert ig.get() == 5 +def test_counter(): + registry = MetricRegistry() + c = registry.counter({'a': 'b'}) + + assert c.inc() == 1 + assert c.add(2) == 3 + c.reset() + assert c.get() == 0 + + UNISTAT_DATA = """[ ["signal1_max", 10], ["signal2_hgram", [[0, 100], [50, 200], [200, 300]]], diff --git a/library/python/monlib/ut/py3/test.py b/library/python/monlib/ut/py3/test.py index 5a68c1653e3..bbb2b42bcad 100644 --- a/library/python/monlib/ut/py3/test.py +++ b/library/python/monlib/ut/py3/test.py @@ -250,6 +250,16 @@ def test_gauge_sensors(): assert ig.get() == 5 +def test_counter(): + registry = MetricRegistry() + c = registry.counter({'a': 'b'}) + + assert c.inc() == 1 + assert c.add(2) == 3 + c.reset() + assert c.get() == 0 + + UNISTAT_DATA = """[ ["signal1_max", 10], ["signal2_hgram", [[0, 100], [50, 200], [200, 300]]], |
