Class: LogStash::Instrument::PeriodicPoller::JVM

Inherits:
Base
  • Object
show all
Defined in:
lib/logstash/instrument/periodic_poller/jvm.rb

Defined Under Namespace

Classes: GarbageCollectorName

Constant Summary

Constants inherited from Base

Base::DEFAULT_OPTIONS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#start, #stop, #update

Methods included from Util::Loggable

included, #logger, #slow_logger

Constructor Details

#initialize(metric, options = {}) ⇒ JVM

Returns a new instance of JVM.



40
41
42
43
# File 'lib/logstash/instrument/periodic_poller/jvm.rb', line 40

def initialize(metric, options = {})
  super(metric, options)
  @load_average = LoadAverage.create
end

Instance Attribute Details

#metricObject (readonly)

Returns the value of attribute metric.



38
39
40
# File 'lib/logstash/instrument/periodic_poller/jvm.rb', line 38

def metric
  @metric
end

Instance Method Details

#collectObject



45
46
47
48
49
50
51
52
53
# File 'lib/logstash/instrument/periodic_poller/jvm.rb', line 45

def collect
  raw = JRMonitor.memory.generate
  collect_jvm_metrics(raw)
  collect_pools_metrics(raw)
  collect_threads_metrics
  collect_process_metrics
  collect_gc_stats
  collect_load_average
end