diff options
author | Erik Johnston <erikj@jki.re> | 2018-04-12 12:18:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-12 12:18:57 +0100 |
commit | 0f13f30fcadc0aec3230435f1e5e8df4f4e6eac7 (patch) | |
tree | 1f52b177c8ca278ed84d568652f892484ef2dc33 /synapse/handlers/appservice.py | |
parent | Merge pull request #3059 from matrix-org/rav/doc_response_cache (diff) | |
parent | Format docstring (diff) | |
download | synapse-0f13f30fcadc0aec3230435f1e5e8df4f4e6eac7.tar.xz |
Merge pull request #3090 from matrix-org/erikj/processed_event_lag
Add metrics for event processing lag
Diffstat (limited to 'synapse/handlers/appservice.py')
-rw-r--r-- | synapse/handlers/appservice.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py index 69eacff949..0245197c02 100644 --- a/synapse/handlers/appservice.py +++ b/synapse/handlers/appservice.py @@ -125,9 +125,23 @@ class ApplicationServicesHandler(object): for evs in events_by_room.itervalues() ], consumeErrors=True)) + yield self.store.set_appservice_last_pos(upper_bound) + + now = self.clock.time_msec() + ts = yield self.store.get_received_ts(events[-1].event_id) + + synapse.metrics.event_processing_positions.set( + upper_bound, "appservice_sender", + ) + events_processed_counter.inc_by(len(events)) - yield self.store.set_appservice_last_pos(upper_bound) + synapse.metrics.event_processing_lag.set( + now - ts, "appservice_sender", + ) + synapse.metrics.event_processing_last_ts.set( + ts, "appservice_sender", + ) finally: self.is_processing = False |