Class: Speedshop::Cloudwatch::Puma

Inherits:
Object
  • Object
show all
Defined in:
lib/speedshop/cloudwatch/puma.rb

Instance Method Summary collapse

Instance Method Details

#collectObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/speedshop/cloudwatch/puma.rb', line 8

def collect
  Observations::Puma.from_stats(::Puma.stats_hash).each do |observation|
    MetricMapper.instance.report(
      metric: observation[:metric],
      value: observation[:value],
      dimensions: observation[:dimensions] || {},
      integration: :puma
    )
  end
rescue => e
  Speedshop::Cloudwatch.log_error("Failed to collect Puma metrics: #{e.message}", e)
end