diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-02-01 17:57:51 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-02-05 15:34:01 +0000 |
commit | bc496df192fa20dee933590d5f21a3425388c0d7 (patch) | |
tree | fefd2b856942185a6fe114cff46ce3228872d06e /tests/metrics/test_metric.py | |
parent | Merge pull request #2837 from matrix-org/rav/fix_quarantine_media (diff) | |
download | synapse-bc496df192fa20dee933590d5f21a3425388c0d7.tar.xz |
report metrics on number of cache evictions
Diffstat (limited to '')
-rw-r--r-- | tests/metrics/test_metric.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/metrics/test_metric.py b/tests/metrics/test_metric.py index f85455a5af..39bde6e3f8 100644 --- a/tests/metrics/test_metric.py +++ b/tests/metrics/test_metric.py @@ -141,6 +141,7 @@ class CacheMetricTestCase(unittest.TestCase): 'cache:hits{name="cache_name"} 0', 'cache:total{name="cache_name"} 0', 'cache:size{name="cache_name"} 0', + 'cache:evicted_size{name="cache_name"} 0', ]) metric.inc_misses() @@ -150,6 +151,7 @@ class CacheMetricTestCase(unittest.TestCase): 'cache:hits{name="cache_name"} 0', 'cache:total{name="cache_name"} 1', 'cache:size{name="cache_name"} 1', + 'cache:evicted_size{name="cache_name"} 0', ]) metric.inc_hits() @@ -158,4 +160,14 @@ class CacheMetricTestCase(unittest.TestCase): 'cache:hits{name="cache_name"} 1', 'cache:total{name="cache_name"} 2', 'cache:size{name="cache_name"} 1', + 'cache:evicted_size{name="cache_name"} 0', + ]) + + metric.inc_evictions(2) + + self.assertEquals(metric.render(), [ + 'cache:hits{name="cache_name"} 1', + 'cache:total{name="cache_name"} 2', + 'cache:size{name="cache_name"} 1', + 'cache:evicted_size{name="cache_name"} 2', ]) |