Class: PrometheusExporter::Instrumentation::GoodJob
Class Method Summary
collapse
Instance Method Summary
collapse
started?, stop, worker_loop
Class Method Details
.start(client: nil, frequency: 30) ⇒ Object
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/prometheus_exporter/instrumentation/good_job.rb', line 6
def self.start(client: nil, frequency: 30)
good_job_collector = new
client ||= PrometheusExporter::Client.default
worker_loop do
client.send_json(good_job_collector.collect)
end
super
end
|
Instance Method Details
#collect ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/prometheus_exporter/instrumentation/good_job.rb', line 17
def collect
{
type: "good_job",
scheduled: ::GoodJob::Job.scheduled.size,
retried: ::GoodJob::Job.retried.size,
queued: ::GoodJob::Job.queued.size,
running: ::GoodJob::Job.running.size,
finished: ::GoodJob::Job.finished.size,
succeeded: ::GoodJob::Job.succeeded.size,
discarded: ::GoodJob::Job.discarded.size
}
end
|