Class: NewRelic::Agent::Samplers::MemorySampler::JavaHeapSampler
- Defined in:
- lib/new_relic/agent/samplers/memory_sampler.rb
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#get_memory ⇒ Object
87 88 89 90 |
# File 'lib/new_relic/agent/samplers/memory_sampler.rb', line 87 def get_memory raise "Can't sample Java heap unless running in JRuby" unless defined? JRuby java.lang.Runtime.getRuntime.totalMemory / (1024 * 1024).to_f rescue nil end |
#to_s ⇒ Object
91 92 93 |
# File 'lib/new_relic/agent/samplers/memory_sampler.rb', line 91 def to_s "JRuby Java heap sampler" end |