From 5f4eca38160c34db4f282948cf6dceebd55f240e Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 19 Feb 2016 10:21:41 +0000 Subject: More metrics --- synapse/handlers/presence.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'synapse/handlers') diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py index 86b94ab84b..c3cfc9441d 100644 --- a/synapse/handlers/presence.py +++ b/synapse/handlers/presence.py @@ -46,6 +46,9 @@ metrics = synapse.metrics.get_metrics_for(__name__) notified_presence_counter = metrics.register_counter("notified_presence") presence_updates_counter = metrics.register_counter("presence_updates") +presence_updates_counter = metrics.register_counter("presence_updates") +timers_fired_counter = metrics.register_counter("timers_fired") +federation_presence_counter = metrics.register_counter("federation_presence") # If a user was last active in the last LAST_ACTIVE_GRANULARITY, consider them @@ -276,6 +279,8 @@ class PresenceHandler(BaseHandler): for user_id in set(users_to_check) ] + timers_fired_counter.inc_by(len(states)) + changes = handle_timeouts( states, is_mine_fn=self.hs.is_mine_id, @@ -507,6 +512,7 @@ class PresenceHandler(BaseHandler): updates.append(prev_state.copy_and_replace(**new_fields)) if updates: + federation_presence_counter.inc_by(len(updates)) yield self._update_states(updates) @defer.inlineCallbacks -- cgit 1.4.1