summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-02-19 10:21:41 +0000
committerErik Johnston <erik@matrix.org>2016-02-19 10:21:41 +0000
commit5f4eca38160c34db4f282948cf6dceebd55f240e (patch)
treeb5cdb981cb109e8068207461186309057645be06
parentAdd presence metrics (diff)
downloadsynapse-5f4eca38160c34db4f282948cf6dceebd55f240e.tar.xz
More metrics
Diffstat (limited to '')
-rw-r--r--synapse/handlers/presence.py6
1 files changed, 6 insertions, 0 deletions
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