def on_shutdown(): if bench_first is not None and bench_last is not None: print('- Time spent in benchmark: {0!r}'.format( bench_last - bench_first)) print('- Avg: {0}'.format( sum(bench_sample) / len(bench_sample))) memdump()
def on_shutdown(): if bench_first is not None and bench_last is not None: print('- Time spent in benchmark: {0!r}'.format(bench_last - bench_first)) print('- Avg: {0}'.format( sum(bench_sample) / len(bench_sample))) memdump()
def memdump(state, samples=10, **kwargs): # pragma: no cover """Dump statistics of previous memsample requests.""" from celery.utils import debug out = io.StringIO() debug.memdump(file=out) return out.getvalue()
def memdump(state, samples=10, **kwargs): # pragma: no cover from celery.utils.debug import memdump out = io.StringIO() memdump(file=out) return out.getvalue()
def on_shutdown(): if bench_first is not None and bench_last is not None: print("- Time spent in benchmark: %r" % ( bench_last - bench_first)) print("- Avg: %s" % (sum(bench_sample) / len(bench_sample))) memdump()
def on_shutdown(): if bench_first is not None and bench_last is not None: print('- Time spent in benchmark: %r' % (bench_last - bench_first)) print('- Avg: %s' % (sum(bench_sample) / len(bench_sample))) memdump()
def memdump(panel, samples=10, **kwargs): from celery.utils.debug import memdump out = StringIO() memdump(file=out) return out.getvalue()