Class: Barnes::Instruments::GctoolsOobgc

Inherits:
Object
  • Object
show all
Defined in:
lib/barnes/instruments/gctools_oobgc.rb

Overview

Tracks out of band GCs that occurred since the last request.

Instance Method Summary collapse

Instance Method Details

#instrument!(state, counters, gauges) ⇒ Object



32
33
34
35
36
37
38
39
40
41
# File 'lib/barnes/instruments/gctools_oobgc.rb', line 32

def instrument!(state, counters, gauges)
  last = state[:oobgc]
  cur = state[:oobgc] = current

  counters.update \
    :'OOBGC.count'        => cur[:count] - last[:count],
    :'OOBGC.major_count'  => cur[:major] - last[:major],
    :'OOBGC.minor_count'  => cur[:minor] - last[:minor],
    :'OOBGC.sweep_count'  => cur[:sweep] - last[:sweep]
end

#start!(state) ⇒ Object



28
29
30
# File 'lib/barnes/instruments/gctools_oobgc.rb', line 28

def start!(state)
  state[:oobgc] = current
end