Metrics
Last updated
Last updated
Taskforce.sh provides some useful metrics for your queues.
The metrics view provides you a glimpse on how your queues are performing, this will allow you to quickly discover if some queue is running slower than what you expect, so that you can take actions to resolve the problems.
The first section of the metrics view shows the global statistics for the queue, the total number of jobs "In Queue", that is, jobs that are currently either waiting for being processed or being processed right now.
It also shows you how many jobs in total have been completed and failed, note that for this metric to be accurate you must either enable metrics on your queues or keep all the completed and failed jobs (usually not recommended since it will consume more and more space from your Redis instance).
The second second section shows real-time metrics for up to the last 2 weeks with a minimum granularity of 1 minute, in other words, you can see how many jobs per minute your queue is completing (or failing).
The third section displays performance statistics. Currently these statistics requires you to keep at least 1k completed jobs on the queue.
In order to enable metrics collection on the queues you need to add the metrics options to your queue.
In Bull you should enable the metrics on every queue instance that defines a processor:
We recommend to keep two weeks of metrics, which would require around 120Kb of RAM from your Redis instance.
In BullMQ you should enable the metrics on every worker: