Skip to content

Metrics

Mike Perham edited this page Jul 27, 2022 · 22 revisions

Sidekiq 7.0 introduces a subsystem for gathering job execution times along with a new Metrics tab within the Web UI to explore this data. The data is designed to help you answer a few questions:

  • Which type of jobs executed?
  • Which type of jobs took the most amount of time to execute?
  • How has the performance of Job X changed over the last hour?
  • When did any deploys occur during this time?

Metrics Home

The Metrics home page shows two lists:

  1. The top N jobs by execution count
  2. The top N jobs by total execution time

Each job links to a detail page where you can see the data for the last hour for that job.

Metrics Job Detail

The detail page shows fine-grained data per-minute for the given job. Each minute has a histogram of execution times.

Deploys

Sidekiq provides a simple API so capistrano scripts or similar can mark a deploy. The Metrics graphs will show a vertical line at that point in time so sudden changes can be correlated. If the current directory is a Git repo, here's a simple script which will label mark each deploy with the current git SHA and commit subject (e.g. "d0f12ab3 Add foo to bar"):

require "sidekiq/metrics/deploy"
gitdesc = `git log -1 --format="%h %s"`.strip
d = Sidekiq::Metrics::Deploy.new
d.mark(label: gitdesc)

Clone this wiki locally