def serialize_node(self, ch_node, verbose=True): node_id = id(ch_node) name = ch_node.short_name ts = time.time() status = ch_node._status mem = get_current_memory() node_cache_info = cache_info(ch_node) rec = { 'id': str(node_id), 'indirect': False, } if verbose: rec.update({ 'name': name, 'ts': ts, 'status': status, 'mem': mem, 'cache': node_cache_info, }) return rec
def pdb_mem(): from monitor import get_current_memory mem = get_current_memory() if mem > 7000: import pdb pdb.set_trace()