felixmosh / bull-board

🎯 Queue background jobs inspector
MIT License
2.3k stars 360 forks source link

Feature: Metrics support #618

Open alko89 opened 1 year ago

alko89 commented 1 year ago

Bull and BullMQ support metrics, which can be enabled with metrics option:

// Bull
new Queue3(
  queueName, 
  {
    metrics: {
      maxDataPoints: MetricsTime.ONE_WEEK 
    }
  }
);

// BullMQ (in worker)
new Worker(
  queueName,
  async (job) => { ... },
  {
    metrics: {
      maxDataPoints: MetricsTime.ONE_WEEK,
    },
  }
);

This enables additional data in Redis, which can be fetched by using getMetrics method and provides information about job completion/failure over time with some additional metadata:

interface Metrics {
    meta: {
        count: number;
        prevTS: number;
        prevCount: number;
    };
    data: number[];
    count: number;
}

This would allow displaying a graph of completed and failed jobs over time, it should also provide information about job response time, process time and throughput.

image

Relates to #258

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.