Class: WarCorrespondent::Reporters::LoadAvg

Inherits:
WarCorrespondent::Reporter show all
Defined in:
lib/warcorrespondent/reporters/loadavg.rb

Instance Attribute Summary

Attributes inherited from WarCorrespondent::Reporter

#identifier, #options, #timeout

Instance Method Summary collapse

Methods inherited from WarCorrespondent::Reporter

#run, #update

Constructor Details

#initialize(args) ⇒ LoadAvg

Returns a new instance of LoadAvg.



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/warcorrespondent/reporters/loadavg.rb', line 4

def initialize(args)
  @block = Proc.new do
    load = SystemInformation::load
    [
      {:identifier => "load:1", :value => load[:load_1]},
      {:identifier => "load:5", :value => load[:load_5]},
      {:identifier => "load:15", :value => load[:load_15]},
      {:identifier => "processes:running", :value => load[:procs_running]},
      {:identifier => "processes:total", :value => load[:procs_total]}
    ]
  end
  super(args)
end