Commit bbf4be10 authored by Ivan Tyagov's avatar Ivan Tyagov

Add separate statistics ZMI page.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16844 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9b1c8575
...@@ -54,11 +54,18 @@ class CacheTool(BaseTool): ...@@ -54,11 +54,18 @@ class CacheTool(BaseTool):
security = ClassSecurityInfo() security = ClassSecurityInfo()
manage_options = ({'label': 'Configure', manage_options = ({'label': 'Configure',
'action': 'cache_tool_configure', 'action': 'cache_tool_configure',
},) + BaseTool.manage_options },
{'label': 'Statistics',
'action': 'cache_tool_statistics',
},
) + BaseTool.manage_options
security.declareProtected( Permissions.ManagePortal, 'cache_tool_configure') security.declareProtected( Permissions.ManagePortal, 'cache_tool_configure')
cache_tool_configure = DTMLFile('cache_tool_configure', _dtmldir) cache_tool_configure = DTMLFile('cache_tool_configure', _dtmldir)
security.declareProtected( Permissions.ManagePortal, 'cache_tool_statistics')
cache_tool_statistics = DTMLFile('cache_tool_statistics', _dtmldir)
def __init__(self): def __init__(self):
BaseTool.__init__(self) BaseTool.__init__(self)
...@@ -228,7 +235,8 @@ class CacheTool(BaseTool): ...@@ -228,7 +235,8 @@ class CacheTool(BaseTool):
ram_cache_root = self.getRamCacheRoot() ram_cache_root = self.getRamCacheRoot()
for cf_key, cf_value in ram_cache_root.items(): for cf_key, cf_value in ram_cache_root.items():
for cp in cf_value.getCachePluginList(): for cp in cf_value.getCachePluginList():
cp_total_size = cp.getCachePluginTotalMemorySize() cp_total_size, cp_cache_keys_total_size = cp.getCachePluginTotalMemorySize()
total_size += cp_total_size total_size += cp_total_size
stats[cf_key] = cp_total_size stats[cf_key] = dict(total = cp_total_size,
return total_size, stats cp_cache_keys_total_size = cp_cache_keys_total_size)
return dict(total_size = total_size, stats = stats)
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