Class: Sidekiq::Prometheus::Exporter::Scheduler

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/prometheus/exporter/scheduler.rb

Defined Under Namespace

Classes: Stats

Constant Summary collapse

TEMPLATE =
ERB.new(File.read(File.expand_path('templates/scheduler.erb', __dir__)))
SECONDS_IN_MINUTE =
60

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScheduler

Returns a new instance of Scheduler.



19
20
21
# File 'lib/sidekiq/prometheus/exporter/scheduler.rb', line 19

def initialize
  @stats = Stats.new(recurring_jobs.count, enabled_recurring_jobs.count, last_runs)
end

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/sidekiq/prometheus/exporter/scheduler.rb', line 15

def self.available?
  defined?(Sidekiq::Scheduler)
end

Instance Method Details

#to_sObject



23
24
25
# File 'lib/sidekiq/prometheus/exporter/scheduler.rb', line 23

def to_s
  TEMPLATE.result(binding).chomp!
end