Skip to content

Instantly share code, notes, and snippets.

@GrahamDumpleton
Created November 16, 2012 03:41
Show Gist options
  • Save GrahamDumpleton/4083833 to your computer and use it in GitHub Desktop.
Save GrahamDumpleton/4083833 to your computer and use it in GitHub Desktop.
Processing profile data.
import pstats
import glob
import sys
filenames = sys.argv[1:]
# Read all stats files into a single object
stats = pstats.Stats(filenames[0])
for i in filenames[1:]:
stats.add(i)
# Clean up filenames for the report
#stats.strip_dirs()
stats.sort_stats('cumulative')
stats.print_stats()
stats.print_callees()
stats.print_callers()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment