Answer the question
In order to leave comments, you need to log in
How to find out the execution time of celery tasks?
How to find the execution time of the Celerial tasks, for example, I have 10 pictures, I create a task.delay () in a loop, how to find out the execution time of 10 tasks, well, or at least one to start
def perfomance():
if request.method == 'GET':
start = timer()
results = []
for path in glob.glob('/home/alenorze/Workspace/Django/hair_backend/test_data/*.jpeg'):
task = create_mask.delay(path)
result = AsyncResult(task.id)
results.append(result)
end = timer()
time = end - start
return render_template('ex.html', time=time, result=result)
Answer the question
In order to leave comments, you need to log in
from time import time as timer
def perfomance():
if request.method == 'GET':
start = timer()
results = []
for path in glob.glob('/home/alenorze/Workspace/Django/hair_backend/test_data/*.jpeg'):
task = create_mask.delay(path)
result = AsyncResult(task.id)
results.append(result)
end = timer()
time = end - start
return render_template('ex.html', time=time, result=result)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question