Esempio n. 1
0
    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
Esempio n. 2
0
def pdb_mem():
    from monitor import get_current_memory
    mem = get_current_memory()
    if mem > 7000:
        import pdb
        pdb.set_trace()