Update appadmin.py
This commit is contained in:
@@ -480,18 +480,18 @@ 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'])
|
||||||
except (KeyError, ZeroDivisionError):
|
except (KeyError, ZeroDivisionError):
|
||||||
total['ratio'] = 0
|
total['ratio'] = 0
|
||||||
|
|
||||||
if disk['oldest'] < ram['oldest']:
|
if disk['oldest'] < ram['oldest']:
|
||||||
total['oldest'] = disk['oldest']
|
total['oldest'] = disk['oldest']
|
||||||
else:
|
else:
|
||||||
@@ -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))
|
||||||
|
|||||||
Reference in New Issue
Block a user