Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def print_stats():
yappi.get_stats(yappi.SORTTYPE_TTOTAL)
file = open(PROFILE_FILE,'a')
for entry in yappi.get_stats(yappi.SORTTYPE_TAVG):
file.write(entry+'\n')
file.close()
vs = Variables()
viewers = Viewers(variables = vs)
iodl = IODriverList(variables = vs, viewers_instance = viewers)
proj = PlotOMatic(io_driver_list = iodl, variables = vs, viewers = viewers)
proj.start()
proj.configure_traits()
proj.stop()
if PROFILE:
print "Generating Statistics"
yappi.stop()
stats = yappi.get_stats(yappi.SORTTYPE_TSUB, yappi.SORTORDER_DESCENDING, 300) #yappi.SHOW_ALL)
for stat in stats:
print stat
def print_stats():
yappi.get_stats(yappi.SORTTYPE_TTOTAL)
file = open(PROFILE_FILE,'a')
for entry in yappi.get_stats(yappi.SORTTYPE_TAVG):
file.write(entry+'\n')
file.close()
rawserver.shutdown()
session_done_flag.set()
break
callback.register(watchdog)
callback.register(start)
rawserver.listen_forever(None)
callback.stop()
if callback.exception:
global exit_exception
exit_exception = callback.exception
if opt.yappi:
yappi.stop()
print "YAPPI:", yappi.clock_type()
stats = yappi.get_stats(yappi.SORTTYPE_TSUB)
for func_stats in stats.func_stats[:50]:
print "YAPPI: %10dx %10.3fs" % (func_stats.ncall, func_stats.tsub), func_stats.name