Update appadmin.py

This commit is contained in:
Chase choi
2015-06-18 16:31:28 +09:00
parent 97489fd277
commit 29bf50425b
+7 -9
View File
@@ -480,12 +480,12 @@ def ccache():
disk['oldest'] = value[0] disk['oldest'] = value[0]
disk['keys'].append((key, GetInHMS(time.time() - value[0]))) disk['keys'].append((key, GetInHMS(time.time() - value[0])))
total['entries'] = ram['entries'] + disk['entries'] ram_keys = ram.keys()
total['bytes'] = ram['bytes'] + disk['bytes'] ram_keys.remove('ratio')
total['objects'] = ram['objects'] + disk['objects'] ram_keys.remove('oldest')
total['hits'] = ram['hits'] + disk['hits'] for key in ram_keys:
total['misses'] = ram['misses'] + disk['misses'] total[key] = ram[key] + disk[key]
total['keys'] = ram['keys'] + disk['keys']
try: try:
total['ratio'] = total['hits'] * 100 / (total['hits'] + total['ratio'] = total['hits'] * 100 / (total['hits'] +
total['misses']) total['misses'])
@@ -577,9 +577,7 @@ def bg_graph_model():
group = meta_graphmodel['group'].replace(' ', '') group = meta_graphmodel['group'].replace(' ', '')
if not subgraphs.has_key(group): if not subgraphs.has_key(group):
subgraphs[group] = dict(meta=meta_graphmodel, tables=[]) subgraphs[group] = dict(meta=meta_graphmodel, tables=[])
subgraphs[group]['tables'].append(tablename) subgraphs[group]['tables'].append(tablename)
else:
subgraphs[group]['tables'].append(tablename)
graph.add_node(tablename, name=tablename, shape='plaintext', graph.add_node(tablename, name=tablename, shape='plaintext',
label=table_template(tablename)) label=table_template(tablename))