Class: OneApm::Collector::JrubyPoller

Inherits:
ShellPoller show all
Defined in:
lib/one_apm/collector/support/jruby_poller.rb

Instance Attribute Summary

Attributes inherited from ShellPoller

#pid

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ShellPoller

#cpu_utilization, kb_page_size

Class Method Details

.enable?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/one_apm/collector/support/jruby_poller.rb', line 8

def self.enable?
  defined?(::JRuby)
end

Instance Method Details

#memoryObject



12
13
14
# File 'lib/one_apm/collector/support/jruby_poller.rb', line 12

def memory
  java.lang.Runtime.getRuntime.totalMemory / (1024 * 1024).to_f rescue nil
end

#to_sObject



16
17
18
# File 'lib/one_apm/collector/support/jruby_poller.rb', line 16

def to_s
  "JrubyPoller from: java.lang.Runtime.getRuntime.totalMemory"
end