summary refs log tree commit diff
path: root/synapse/handlers/presence.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-03-02 14:36:10 +0000
committerErik Johnston <erik@matrix.org>2016-03-02 14:36:10 +0000
commit2a78dac60dc5d7ba7050386ba864f83f8d19e8e6 (patch)
tree5acc2246661fece680929dacbe73522b336cdce8 /synapse/handlers/presence.py
parentMerge pull request #489 from matrix-org/markjh/replication (diff)
parentSet SYNAPSE_CACHE_FACTOR=1 in jenkins (diff)
downloadsynapse-2a78dac60dc5d7ba7050386ba864f83f8d19e8e6.tar.xz
Merge pull request #612 from matrix-org/erikj/cache_size
Add environment variable SYNAPSE_CACHE_FACTOR, default it to 0.1
Diffstat (limited to 'synapse/handlers/presence.py')
-rw-r--r--synapse/handlers/presence.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index d98e80086e..f6cf343174 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -130,6 +130,10 @@ class PresenceHandler(BaseHandler):
             for state in active_presence
         }
 
+        metrics.register_callback(
+            "user_to_current_state_size", lambda: len(self.user_to_current_state)
+        )
+
         now = self.clock.time_msec()
         for state in active_presence:
             self.wheel_timer.insert(