summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-03-01 12:56:39 +0000
committerErik Johnston <erik@matrix.org>2016-03-01 12:56:39 +0000
commit910fc0f28f82ca7c719b5bbe98f4d3c2d0d76abf (patch)
tree7f3562e80c4557189de140e1075d7597b39fc148 /synapse/handlers
parentMerge pull request #611 from matrix-org/erikj/expiring_cache_size (diff)
downloadsynapse-910fc0f28f82ca7c719b5bbe98f4d3c2d0d76abf.tar.xz
Add enviroment variable SYNAPSE_CACHE_FACTOR, default it to 0.1
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/presence.py4
-rw-r--r--synapse/handlers/receipts.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index 08e38cdd25..a5c363e390 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(
diff --git a/synapse/handlers/receipts.py b/synapse/handlers/receipts.py
index de4c694714..935c339707 100644
--- a/synapse/handlers/receipts.py
+++ b/synapse/handlers/receipts.py
@@ -36,8 +36,6 @@ class ReceiptsHandler(BaseHandler):
         )
         self.clock = self.hs.get_clock()
 
-        self._receipt_cache = None
-
     @defer.inlineCallbacks
     def received_client_receipt(self, room_id, receipt_type, user_id,
                                 event_id):