summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-01-28 17:27:28 +0000
committerErik Johnston <erik@matrix.org>2016-01-28 17:27:28 +0000
commit0663c5bd52d52e095258e312fb62c2a9cb3f200a (patch)
tree3bf102a5958a3f504f14bf2c0839ec5e63f3d4fc
parentAdd events index (diff)
downloadsynapse-0663c5bd52d52e095258e312fb62c2a9cb3f200a.tar.xz
Include cache hits with has_entity_changed
-rw-r--r--synapse/util/caches/stream_change_cache.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/util/caches/stream_change_cache.py b/synapse/util/caches/stream_change_cache.py
index 3ca0e57780..b48f5cb273 100644
--- a/synapse/util/caches/stream_change_cache.py
+++ b/synapse/util/caches/stream_change_cache.py
@@ -46,15 +46,19 @@ class StreamChangeCache(object):
         assert type(stream_pos) is int
 
         if stream_pos <= self._earliest_known_stream_pos:
+            cache_counter.inc_misses(self.name)
             return True
 
         latest_entity_change_pos = self._entity_to_key.get(entity, None)
         if latest_entity_change_pos is None:
+            cache_counter.inc_misses(self.name)
             return True
 
         if stream_pos < latest_entity_change_pos:
+            cache_counter.inc_misses(self.name)
             return True
 
+        cache_counter.inc_hits(self.name)
         return False
 
     def get_entities_changed(self, entities, stream_pos):