-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Metrics
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?
The Metrics home page shows two lists:
- The top N jobs by execution count
- 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.
The detail page shows fine-grained data per-minute for the given job. Each minute has a histogram of execution times.
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)