diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2020-09-30 19:33:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-30 19:33:27 +0100 |
commit | a0a1ba697325601e1b1edf81a722b2354680b2c6 (patch) | |
tree | cf4916637fe948f8d2b3a7783e968f06b2b55f74 /tests/storage | |
parent | Allow additional SSO properties to be passed to the client (#8413) (diff) | |
parent | changelog (diff) | |
download | synapse-a0a1ba697325601e1b1edf81a722b2354680b2c6.tar.xz |
Merge pull request #8425 from matrix-org/rav/extremity_metrics
Add an improved "forward extremities" metric
Diffstat (limited to 'tests/storage')
-rw-r--r-- | tests/storage/test_event_metrics.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/storage/test_event_metrics.py b/tests/storage/test_event_metrics.py index 949846fe33..3957471f3f 100644 --- a/tests/storage/test_event_metrics.py +++ b/tests/storage/test_event_metrics.py @@ -52,14 +52,14 @@ class ExtremStatisticsTestCase(HomeserverTestCase): self.reactor.advance(60 * 60 * 1000) self.pump(1) - items = set( + items = list( filter( lambda x: b"synapse_forward_extremities_" in x, - generate_latest(REGISTRY).split(b"\n"), + generate_latest(REGISTRY, emit_help=False).split(b"\n"), ) ) - expected = { + expected = [ b'synapse_forward_extremities_bucket{le="1.0"} 0.0', b'synapse_forward_extremities_bucket{le="2.0"} 2.0', b'synapse_forward_extremities_bucket{le="3.0"} 2.0', @@ -72,9 +72,12 @@ class ExtremStatisticsTestCase(HomeserverTestCase): b'synapse_forward_extremities_bucket{le="100.0"} 3.0', b'synapse_forward_extremities_bucket{le="200.0"} 3.0', b'synapse_forward_extremities_bucket{le="500.0"} 3.0', - b'synapse_forward_extremities_bucket{le="+Inf"} 3.0', - b"synapse_forward_extremities_count 3.0", - b"synapse_forward_extremities_sum 10.0", - } - + # per https://docs.google.com/document/d/1KwV0mAXwwbvvifBvDKH_LU1YjyXE_wxCkHNoCGq1GX0/edit#heading=h.wghdjzzh72j9, + # "inf" is valid: "this includes variants such as inf" + b'synapse_forward_extremities_bucket{le="inf"} 3.0', + b"# TYPE synapse_forward_extremities_gcount gauge", + b"synapse_forward_extremities_gcount 3.0", + b"# TYPE synapse_forward_extremities_gsum gauge", + b"synapse_forward_extremities_gsum 10.0", + ] self.assertEqual(items, expected) |