class Trashed::Instruments::RubyGC

Constants

MEASUREMENTS

Public Instance Methods

measure(state, timings, gauges) click to toggle source
# File lib/trashed/instruments/ruby_gc.rb, line 26
def measure(state, timings, gauges)
  gc = GC.stat
  before = state[:ruby_gc]

  MEASUREMENTS.each do |stat, metric|
    timings[metric] = gc[stat] - before[stat] if gc.include? stat
  end

  gauges.concat gc.map { |k, v| [ :"GC.#{k}", v ] }
end
start(state, timings, gauges) click to toggle source
# File lib/trashed/instruments/ruby_gc.rb, line 4
def start(state, timings, gauges)
  state[:ruby_gc] = GC.stat
end