Class: Sidekiq::Prometheus::Exporter::Standard

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

Defined Under Namespace

Classes: HostStats, QueueStats, QueueWorkersStats, WorkersStats

Constant Summary collapse

UNKNOWN_IDENTITY =
'unknown-identity'.freeze
BYTES_IN_KILOBYTE =
1024
OMIT_NEWLINES_MODE =
'<>'.freeze
TEMPLATE =
ERB.new(
  File.read(File.expand_path('templates/standard.erb', __dir__)),
  trim_mode: OMIT_NEWLINES_MODE
)

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStandard

Returns a new instance of Standard.



31
32
33
34
35
36
37
38
39
# File 'lib/sidekiq/prometheus/exporter/standard.rb', line 31

def initialize
  # Version dependent metrics
  @show_memory_usage = false

  @overview_stats = Sidekiq::Stats.new
  @queues_stats = queues_stats
  @workers_stats = workers_stats
  @max_processing_times = max_processing_times
end

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/sidekiq/prometheus/exporter/standard.rb', line 27

def self.available?
  true
end

Instance Method Details

#to_sObject



41
42
43
# File 'lib/sidekiq/prometheus/exporter/standard.rb', line 41

def to_s
  TEMPLATE.result(binding)
end