Class: Distem::DataCollection::ProbeLoadAvg

Inherits:
Probe
  • Object
show all
Defined in:
lib/distem/datacollection/probe_loadavg.rb

Instance Attribute Summary

Attributes inherited from Probe

#data

Instance Method Summary (collapse)

Methods inherited from Probe

#restart, #run, #stop

Constructor Details

- (ProbeLoadAvg) initialize(drift, data, opts = nil)

Returns a new instance of ProbeLoadAvg



6
7
8
# File 'lib/distem/datacollection/probe_loadavg.rb', line 6

def initialize(drift, data, opts = nil)
  super(drift, data, opts)
end

Instance Method Details

- (Object) get_value



10
11
12
13
# File 'lib/distem/datacollection/probe_loadavg.rb', line 10

def get_value
  output = `cat /proc/loadavg`.split(' ')
  return [output[0].to_f, output[1].to_f, output[2].to_f]
end