Skip to content
Snippets Groups Projects
Commit 0663c5bd authored by Erik Johnston's avatar Erik Johnston
Browse files

Include cache hits with has_entity_changed

parent fdca8ec4
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment