Class: Sidekiq::Datadog::Monitor::MetricsSender

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/datadog/monitor/metrics_sender.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(statsd, tags_builder) ⇒ MetricsSender

Returns a new instance of MetricsSender.



8
9
10
11
# File 'lib/sidekiq/datadog/monitor/metrics_sender.rb', line 8

def initialize(statsd, tags_builder)
  @statsd = statsd
  @tags_builder = tags_builder
end

Instance Attribute Details

#statsdObject (readonly)

Returns the value of attribute statsd.



7
8
9
# File 'lib/sidekiq/datadog/monitor/metrics_sender.rb', line 7

def statsd
  @statsd
end

#tags_builderObject (readonly)

Returns the value of attribute tags_builder.



7
8
9
# File 'lib/sidekiq/datadog/monitor/metrics_sender.rb', line 7

def tags_builder
  @tags_builder
end

Instance Method Details

#send_metricsObject



13
14
15
16
17
18
19
20
21
# File 'lib/sidekiq/datadog/monitor/metrics_sender.rb', line 13

def send_metrics
  Sidekiq::Queue.all.each do |queue|
    post_queue_stats(queue)
  end
  Sidekiq::ProcessSet.new.each do |process|
    post_process_stats(process)
  end
  post_scheduled_stats
end