Suresh
Suresh

Reputation: 475

How to fetch the number of tasks My Celery App processed

I've a Celery App which is using redis as a broker and I can fetch the stats of the app using the below command

celery -A test.celeryapp inspect stats

This is giving me some numbers like below

"total": {
        "test.celerytasks._generate_data": 14493666,
        "test.celerytasks.cleanup_data": 14493,
     }

Are these numbers describe that these tasks got executed this many number of times from day1? How to understand these results

How should I get the number of celery tasks which were processed in the last 1 hour/day? Can I get the list of expired tasks in the last one hour/day?

Is there any feasibility to achieve this?

Upvotes: 0

Views: 281

Answers (1)

2ps
2ps

Reputation: 15926

Are these numbers describe that these tasks got executed this many number of times from day1? How to understand these results.

These numbers are the total from the last time celery was restarted. Essentially, each worker on each node keeps track of its own stats per task and then reports that back to the inspect command, which will then aggregate the results.

How should I get the number of celery tasks which were processed in the last 1 hour/day? Can I get the list of expired tasks in the last one hour/day?

You can run flower in persistent mode and check the saved state db

Upvotes: 1

Related Questions