mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 21:54:55 -04:00
Track cache invalidations (#12000)
Currently we only track evictions due to size or time constraints.
This commit is contained in:
parent
dc9fe61050
commit
0dbbe33a65
4 changed files with 10 additions and 1 deletions
|
@ -133,6 +133,11 @@ class ExpiringCache(Generic[KT, VT]):
|
|||
raise KeyError(key)
|
||||
return default
|
||||
|
||||
if self.iterable:
|
||||
self.metrics.inc_evictions(EvictionReason.invalidation, len(value.value))
|
||||
else:
|
||||
self.metrics.inc_evictions(EvictionReason.invalidation)
|
||||
|
||||
return value.value
|
||||
|
||||
def __contains__(self, key: KT) -> bool:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue