Class: Sidekiq::Prometheus::Exporter::Cron

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

Constant Summary collapse

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCron

Returns a new instance of Cron.



16
17
18
# File 'lib/sidekiq/prometheus/exporter/cron.rb', line 16

def initialize
  @cron_jobs_count = Sidekiq::Cron::Job.count
end

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/sidekiq/prometheus/exporter/cron.rb', line 12

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

Instance Method Details

#to_sObject



20
21
22
# File 'lib/sidekiq/prometheus/exporter/cron.rb', line 20

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