checkpoint

This commit is contained in:
mdipierro
2018-03-05 15:17:28 -06:00
parent 2bcd0c2f10
commit 8575b6bf2b
6 changed files with 28 additions and 30 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.16.1-stable+timestamp.2017.11.13.23.50.07
Version 2.16.1-stable+timestamp.2018.02.26.19.05.23
+10 -11
View File
@@ -392,12 +392,11 @@ def ccache():
cache.disk.clear()
session.flash += T("Disk Cleared")
redirect(URL(r=request))
try:
from guppy import hpy
hp = hpy()
from pympler.asizeof import asizeof
except ImportError:
hp = False
asizeof = False
import shelve
import os
@@ -451,9 +450,9 @@ def ccache():
ram['ratio'] = 0
for key, value in iteritems(cache.ram.storage):
if hp:
ram['bytes'] += hp.iso(value[1]).size
ram['objects'] += hp.iso(value[1]).count
if asizeof:
ram['bytes'] += asizeof(value[1])
ram['objects'] += 1
ram['entries'] += 1
if value[0] < ram['oldest']:
ram['oldest'] = value[0]
@@ -469,9 +468,9 @@ def ccache():
except (KeyError, ZeroDivisionError):
disk['ratio'] = 0
else:
if hp:
disk['bytes'] += hp.iso(value[1]).size
disk['objects'] += hp.iso(value[1]).count
if asizeof:
disk['bytes'] += asizeof(value[1])
disk['objects'] += 1
disk['entries'] += 1
if value[0] < disk['oldest']:
disk['oldest'] = value[0]
@@ -511,7 +510,7 @@ def ccache():
total['keys'] = key_table(total['keys'])
return dict(form=form, total=total,
ram=ram, disk=disk, object_stats=hp != False)
ram=ram, disk=disk, object_stats=asizeof != False)
def table_template(table):
+3 -3
View File
@@ -148,7 +148,7 @@
{{=T.M("(**%.0d MB**)", total['bytes'] / 1048576)}}
{{pass}}
{{else:}}
{{=T.M("**not available** (requires the Python [[guppy http://pypi.python.org/pypi/guppy/ popup]] library)")}}
{{=T.M("**not available** (requires the Python [[Pympler https://pypi.python.org/pypi/Pympler popup]] library)")}}
{{pass}}
</p>
<p>
@@ -176,7 +176,7 @@
{{=T.M("(**%.0d MB**)", ram['bytes'] / 10485576)}}
{{pass}}
{{else:}}
{{=T.M("``**not available**``:red (requires the Python [[guppy http://pypi.python.org/pypi/guppy/ popup]] library)")}}
{{=T.M("``**not available**``:red (requires the Python [[Pympler https://pypi.python.org/pypi/Pympler popup]] library)")}}
{{pass}}
</p>
<p>
@@ -205,7 +205,7 @@
{{=T.M("(**%.0d MB**)", disk['bytes'] / 1048576)}}
{{pass}}
{{else:}}
{{=T.M("``**not available**``:red (requires the Python [[guppy http://pypi.python.org/pypi/guppy/ popup]] library)")}}
{{=T.M("``**not available**``:red (requires the Python [[Pympler https://pypi.python.org/pypi/Pympler popup]] library)")}}
{{pass}}
</p>
<p>
+10 -11
View File
@@ -392,12 +392,11 @@ def ccache():
cache.disk.clear()
session.flash += T("Disk Cleared")
redirect(URL(r=request))
try:
from guppy import hpy
hp = hpy()
from pympler.asizeof import asizeof
except ImportError:
hp = False
asizeof = False
import shelve
import os
@@ -451,9 +450,9 @@ def ccache():
ram['ratio'] = 0
for key, value in iteritems(cache.ram.storage):
if hp:
ram['bytes'] += hp.iso(value[1]).size
ram['objects'] += hp.iso(value[1]).count
if asizeof:
ram['bytes'] += asizeof(value[1])
ram['objects'] += 1
ram['entries'] += 1
if value[0] < ram['oldest']:
ram['oldest'] = value[0]
@@ -469,9 +468,9 @@ def ccache():
except (KeyError, ZeroDivisionError):
disk['ratio'] = 0
else:
if hp:
disk['bytes'] += hp.iso(value[1]).size
disk['objects'] += hp.iso(value[1]).count
if asizeof:
disk['bytes'] += asizeof(value[1])
disk['objects'] += 1
disk['entries'] += 1
if value[0] < disk['oldest']:
disk['oldest'] = value[0]
@@ -511,7 +510,7 @@ def ccache():
total['keys'] = key_table(total['keys'])
return dict(form=form, total=total,
ram=ram, disk=disk, object_stats=hp != False)
ram=ram, disk=disk, object_stats=asizeof != False)
def table_template(table):
+3 -3
View File
@@ -148,7 +148,7 @@
{{=T.M("(**%.0d MB**)", total['bytes'] / 1048576)}}
{{pass}}
{{else:}}
{{=T.M("**not available** (requires the Python [[guppy http://pypi.python.org/pypi/guppy/ popup]] library)")}}
{{=T.M("**not available** (requires the Python [[Pympler https://pypi.python.org/pypi/Pympler popup]] library)")}}
{{pass}}
</p>
<p>
@@ -176,7 +176,7 @@
{{=T.M("(**%.0d MB**)", ram['bytes'] / 10485576)}}
{{pass}}
{{else:}}
{{=T.M("``**not available**``:red (requires the Python [[guppy http://pypi.python.org/pypi/guppy/ popup]] library)")}}
{{=T.M("``**not available**``:red (requires the Python [[Pympler https://pypi.python.org/pypi/Pympler popup]] library)")}}
{{pass}}
</p>
<p>
@@ -205,7 +205,7 @@
{{=T.M("(**%.0d MB**)", disk['bytes'] / 1048576)}}
{{pass}}
{{else:}}
{{=T.M("``**not available**``:red (requires the Python [[guppy http://pypi.python.org/pypi/guppy/ popup]] library)")}}
{{=T.M("``**not available**``:red (requires the Python [[Pympler https://pypi.python.org/pypi/Pympler popup]] library)")}}
{{pass}}
</p>
<p>