Class: Upfluence::Instrumentation::GCInstrumenter
Constant Summary
collapse
- KEYS =
%i[
heap_live_slots heap_free_slots major_gc_count minor_gc_count
total_allocated_objects
].freeze
Instance Method Summary
collapse
#initialize, #start, #stop
Instance Method Details
#metrics ⇒ Object
15
16
17
18
19
|
# File 'lib/upfluence/instrumentation/gc_instrumenter.rb', line 15
def metrics
KEYS.reduce({}) do |acc, k|
acc.merge(k => { docstring: "Gauge for #{k}" })
end
end
|
#prefix ⇒ Object
11
12
13
|
# File 'lib/upfluence/instrumentation/gc_instrumenter.rb', line 11
def prefix
'ruby_gc'
end
|
#values ⇒ Object
21
22
23
24
25
|
# File 'lib/upfluence/instrumentation/gc_instrumenter.rb', line 21
def values
GC.stat.slice(*KEYS).reduce({}) do |acc, (k, v)|
acc.merge(k => [{ value: v }])
end
end
|