Class: Autotuner::GCContext
- Inherits:
-
Object
- Object
- Autotuner::GCContext
- Defined in:
- lib/autotuner/gc_context.rb
Constant Summary collapse
- HAS_STAT_HEAP =
GC.respond_to?(:stat_heap)
Instance Attribute Summary collapse
-
#latest_gc_info ⇒ Object
readonly
Returns the value of attribute latest_gc_info.
-
#stat ⇒ Object
readonly
Returns the value of attribute stat.
-
#stat_heap ⇒ Object
readonly
Returns the value of attribute stat_heap.
Instance Method Summary collapse
-
#initialize ⇒ GCContext
constructor
A new instance of GCContext.
- #update ⇒ Object
Constructor Details
#initialize ⇒ GCContext
Returns a new instance of GCContext.
13 14 15 16 17 18 19 20 |
# File 'lib/autotuner/gc_context.rb', line 13 def initialize @stat = GC.stat @latest_gc_info = GC.latest_gc_info if HAS_STAT_HEAP @stat_heap = GC.stat_heap end end |
Instance Attribute Details
#latest_gc_info ⇒ Object (readonly)
Returns the value of attribute latest_gc_info.
7 8 9 |
# File 'lib/autotuner/gc_context.rb', line 7 def latest_gc_info @latest_gc_info end |
#stat ⇒ Object (readonly)
Returns the value of attribute stat.
7 8 9 |
# File 'lib/autotuner/gc_context.rb', line 7 def stat @stat end |
#stat_heap ⇒ Object (readonly)
Returns the value of attribute stat_heap.
10 11 12 |
# File 'lib/autotuner/gc_context.rb', line 10 def stat_heap @stat_heap end |
Instance Method Details
#update ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/autotuner/gc_context.rb', line 22 def update GC.stat(@stat) GC.latest_gc_info(@latest_gc_info) if HAS_STAT_HEAP GC.stat_heap(nil, @stat_heap) end end |