Class: Trashed::Instruments::GctoolsOobgc

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

Overview

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

Instance Method Summary collapse

Instance Method Details

#measure(state, timings, gauges) ⇒ Object



23
24
# File 'lib/trashed/instruments/gctools_oobgc.rb', line 23

def measure(state, timings, gauges)
end

#start(state, timings, gauges) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/trashed/instruments/gctools_oobgc.rb', line 5

def start(state, timings, gauges)
  last = state[:persistent][:oobgc] || Hash.new(0)

  current = {
    :count => GC::OOB.stat(:count).to_i,
    :major => GC::OOB.stat(:major).to_i,
    :minor => GC::OOB.stat(:minor).to_i,
    :sweep => GC::OOB.stat(:sweep).to_i }

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

  state[:persistent][:oobgc] = current
end