diagnostics
eric 2019-08-05 12:17:01 -04:00
parent eccd3b5a18
commit a20ca93d04
1 changed files with 6 additions and 0 deletions

View File

@ -13,10 +13,15 @@ import resource
import sys
from collections import Mapping, Container
from sys import getsizeof
import threading
import cherrypy
from cherrypy.lib.sessions import RamSession
from Page import Page
def thread_info():
return [t.name for t in threading.enumerate()]
def deep_getsizeof(o, ids):
"""Find the memory footprint of a Python object
@ -66,5 +71,6 @@ class DiagnosticsPage (Page):
stats['allocated_blocks'] = sys.getallocatedblocks()
stats['rusage_self'] = resource.getrusage(resource.RUSAGE_SELF)
stats['rusage_children'] = resource.getrusage(resource.RUSAGE_CHILDREN)
stats['thread_info'] = thread_info()
return stats