mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Fix Prometheus metrics being negative (mixed up start/end) (#13584)
Fix: - https://github.com/matrix-org/synapse/pull/13535#discussion_r949582508 - https://github.com/matrix-org/synapse/pull/13533#discussion_r949577244
This commit is contained in:
parent
3dd175b628
commit
9385c41ba4
1
changelog.d/13584.misc
Normal file
1
changelog.d/13584.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Add metrics to time how long it takes us to do backfill processing (`synapse_federation_backfill_processing_before_time_seconds`, `synapse_federation_backfill_processing_after_time_seconds`).
|
@ -86,9 +86,14 @@ backfill_processing_before_timer = Histogram(
|
|||||||
"sec",
|
"sec",
|
||||||
[],
|
[],
|
||||||
buckets=(
|
buckets=(
|
||||||
|
0.1,
|
||||||
|
0.5,
|
||||||
1.0,
|
1.0,
|
||||||
|
2.5,
|
||||||
5.0,
|
5.0,
|
||||||
|
7.5,
|
||||||
10.0,
|
10.0,
|
||||||
|
15.0,
|
||||||
20.0,
|
20.0,
|
||||||
30.0,
|
30.0,
|
||||||
40.0,
|
40.0,
|
||||||
@ -482,7 +487,7 @@ class FederationHandler:
|
|||||||
|
|
||||||
processing_end_time = self.clock.time_msec()
|
processing_end_time = self.clock.time_msec()
|
||||||
backfill_processing_before_timer.observe(
|
backfill_processing_before_timer.observe(
|
||||||
(processing_start_time - processing_end_time) / 1000
|
(processing_end_time - processing_start_time) / 1000
|
||||||
)
|
)
|
||||||
|
|
||||||
success = await try_backfill(likely_domains)
|
success = await try_backfill(likely_domains)
|
||||||
|
@ -104,15 +104,25 @@ backfill_processing_after_timer = Histogram(
|
|||||||
"sec",
|
"sec",
|
||||||
[],
|
[],
|
||||||
buckets=(
|
buckets=(
|
||||||
|
0.1,
|
||||||
|
0.25,
|
||||||
|
0.5,
|
||||||
1.0,
|
1.0,
|
||||||
|
2.5,
|
||||||
5.0,
|
5.0,
|
||||||
|
7.5,
|
||||||
10.0,
|
10.0,
|
||||||
|
15.0,
|
||||||
20.0,
|
20.0,
|
||||||
|
25.0,
|
||||||
30.0,
|
30.0,
|
||||||
40.0,
|
40.0,
|
||||||
|
50.0,
|
||||||
60.0,
|
60.0,
|
||||||
80.0,
|
80.0,
|
||||||
|
100.0,
|
||||||
120.0,
|
120.0,
|
||||||
|
150.0,
|
||||||
180.0,
|
180.0,
|
||||||
"+Inf",
|
"+Inf",
|
||||||
),
|
),
|
||||||
|
@ -116,9 +116,13 @@ messsages_response_timer = Histogram(
|
|||||||
2.5,
|
2.5,
|
||||||
5.0,
|
5.0,
|
||||||
10.0,
|
10.0,
|
||||||
|
20.0,
|
||||||
30.0,
|
30.0,
|
||||||
60.0,
|
60.0,
|
||||||
|
80.0,
|
||||||
|
100.0,
|
||||||
120.0,
|
120.0,
|
||||||
|
150.0,
|
||||||
180.0,
|
180.0,
|
||||||
"+Inf",
|
"+Inf",
|
||||||
),
|
),
|
||||||
@ -674,7 +678,7 @@ class RoomMessageListRestServlet(RestServlet):
|
|||||||
room_member_count = await make_deferred_yieldable(room_member_count_deferred)
|
room_member_count = await make_deferred_yieldable(room_member_count_deferred)
|
||||||
messsages_response_timer.labels(
|
messsages_response_timer.labels(
|
||||||
room_size=_RoomSize.from_member_count(room_member_count)
|
room_size=_RoomSize.from_member_count(room_member_count)
|
||||||
).observe((processing_start_time - processing_end_time) / 1000)
|
).observe((processing_end_time - processing_start_time) / 1000)
|
||||||
|
|
||||||
return 200, msgs
|
return 200, msgs
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user