Class: Upfluence::Instrumentation::PumaInstrumenter
Constant Summary
collapse
- KEYS =
i[backlog_thread running_thread pool_capacity requests_count].freeze
Instance Method Summary
collapse
#initialize, #start, #stop
Instance Method Details
#metrics ⇒ Object
13
14
15
16
17
|
# File 'lib/upfluence/instrumentation/puma_instrumenter.rb', line 13
def metrics
KEYS.reduce({}) do |acc, k|
acc.merge(k => { docstring: "Gauge for #{k}" })
end
end
|
#prefix ⇒ Object
9
10
11
|
# File 'lib/upfluence/instrumentation/puma_instrumenter.rb', line 9
def prefix
'puma'
end
|
#values ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/upfluence/instrumentation/puma_instrumenter.rb', line 19
def values
stats = Puma.stats_hash
{
requests_count: [{ value: stats[:requests_count] }],
backlog_thread: [{ value: stats[:backlog] }],
running_thread: [{ value: stats[:running] }],
pool_capacity: [{ value: stats[:pool_capacity] }]
}
rescue NoMethodError
{}
end
|