Skip to content

Instantly share code, notes, and snippets.

@justecorruptio
Created January 25, 2018 22:01
Embed
What would you like to do?
inline debugger
import cProfile, logging, cStringIO, pstats
prof = cProfile.Profile()
score_list = prof.runcall(model.score, scoring_data)
prof.create_stats()
stream = cStringIO.StringIO()
stats = pstats.Stats(prof, stream=stream)
stats.strip_dirs().sort_stats('time').print_stats(20)
#print stream.getvalue()
logging.getLogger().info(stream.getvalue())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment