MCPcopy
hub / github.com/celery/celery / bench_work

Function bench_work

t/benchmarks/bench_worker.py:75–87  ·  view source on GitHub ↗
(n=DEFAULT_ITS, loglevel='CRITICAL')

Source from the content-addressed store, hash-verified

73
74
75def bench_work(n=DEFAULT_ITS, loglevel='CRITICAL'):
76 loglevel = os.environ.get('BENCH_LOGLEVEL') or loglevel
77 if loglevel:
78 app.log.setup_logging_subsystem(loglevel=loglevel)
79 worker = app.WorkController(concurrency=15,
80 queues=['bench.worker'])
81
82 try:
83 print('-- starting worker')
84 worker.start()
85 except SystemExit:
86 assert sum(worker.state.total_count.values()) == n + 1
87 raise
88
89
90def bench_both(n=DEFAULT_ITS):

Callers 1

bench_bothFunction · 0.85

Calls 4

startMethod · 0.95
WorkControllerMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected