module
Sidekiq::Metrics::Query
Defined in:
sidekiq/metrics/query.crClass Method Summary
-
.aggregate(data : Hash(Int64, Hash(String, String))) : NamedTuple(success: Int64, failure: Int64, total_ms: Float64)
Aggregate metrics data for display Returns totals for success, failure, total_ms across all timestamps
-
.fetch(job_class : String, start_time : Time, end_time : Time) : Hash(Int64, Hash(String, String))
Fetch metrics for a specific job class within a time range Returns a hash of timestamp => metrics data Results are cached for 60 seconds to reduce Redis load
-
.job_classes : Array(String)
Get all job classes that have metrics data
-
.record(job_class : String, duration_ms : Float64, success : Bool, timestamp : Int64 = Metrics.minute_timestamp)
Record job execution metrics to Redis - job_class: The worker class name (e.g., "HardWorker") - duration_ms: Execution time in milliseconds - success: Whether the job completed without raising an exception - timestamp: Unix timestamp truncated to minute (defaults to current time)
Class Method Detail
Aggregate metrics data for display Returns totals for success, failure, total_ms across all timestamps
Fetch metrics for a specific job class within a time range Returns a hash of timestamp => metrics data Results are cached for 60 seconds to reduce Redis load
Record job execution metrics to Redis
- job_class: The worker class name (e.g., "HardWorker")
- duration_ms: Execution time in milliseconds
- success: Whether the job completed without raising an exception
- timestamp: Unix timestamp truncated to minute (defaults to current time)