Commit 8dcfc6cb authored by Ivan Tyagov's avatar Ivan Tyagov

Extend statistics, return dictionary of cache_key:memory_used.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16845 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bbf4be10
......@@ -135,7 +135,9 @@ class RamCache(BaseCache):
from guppy import hpy
h = hpy()
total_size = 0
cache_keys_total_size = {}
for cache_key, cache_value in self._cache_dict[DEFAULT_CACHE_SCOPE].items():
cache_value = cache_value.getValue()
total_size += calcPythonObjectMemorySize(h, cache_value)
return total_size
cache_item_size = calcPythonObjectMemorySize(h, cache_value.getValue())
total_size += cache_item_size
cache_keys_total_size[cache_key] = cache_item_size
return total_size, cache_keys_total_size
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment