Skip to content

Commit

Permalink
tracemalloc diffs against start snapshot.
Browse files Browse the repository at this point in the history
  • Loading branch information
mborho committed Jan 25, 2018
1 parent 92195e9 commit 8a612cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions livebridge/profiler.py
Expand Up @@ -68,7 +68,7 @@ async def display_top(snapshot, key_type='lineno', limit=15):
async def display_diff(snapshot, key_type='lineno', limit=15):
global snapshot_prev
if snapshot_prev:
logging.debug("Top %s differences" % limit)
logging.debug("Top %s differences from start" % limit)
top_diffs= snapshot.compare_to(snapshot_prev, 'lineno')
for x, stat in enumerate([x for x in top_diffs[:limit]], 1):
frame = stat.traceback[0]
Expand All @@ -80,5 +80,6 @@ async def display_diff(snapshot, key_type='lineno', limit=15):
if line:
logging.debug(' %s' % line)
logging.debug("\n\n")
snapshot_prev = snapshot
if not snapshot_prev:
snapshot_prev = snapshot

0 comments on commit 8a612cb

Please sign in to comment.