Class: NewRelic::Agent::StatsEngine::GCProfiler::Profiler
- Inherits:
-
Object
- Object
- NewRelic::Agent::StatsEngine::GCProfiler::Profiler
show all
- Defined in:
- lib/new_relic/agent/stats_engine/gc_profiler.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of Profiler.
17
18
19
20
21
22
|
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 17
def initialize
if self.class.enabled?
@last_timestamp = call_time
@last_count = call_count
end
end
|
Instance Method Details
#capture ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 24
def capture
return unless self.class.enabled?
return if !scope_stack.empty? && scope_stack.last.name == "GC/cumulative"
num_calls = call_count - @last_count
elapsed = (call_time - @last_timestamp).to_f
@last_timestamp = call_time
@last_count = call_count
reset
record_gc_metric(num_calls, elapsed)
end
|
#reset ⇒ Object
37
|
# File 'lib/new_relic/agent/stats_engine/gc_profiler.rb', line 37
def reset; end
|