Class: WarCorrespondent::Reporters::CPU
- Inherits:
-
WarCorrespondent::Reporter
- Object
- WarCorrespondent::Reporter
- WarCorrespondent::Reporters::CPU
- Defined in:
- lib/warcorrespondent/reporters/cpu.rb
Instance Attribute Summary
Attributes inherited from WarCorrespondent::Reporter
#identifier, #options, #timeout
Instance Method Summary collapse
-
#initialize(args) ⇒ CPU
constructor
A new instance of CPU.
Methods inherited from WarCorrespondent::Reporter
Constructor Details
#initialize(args) ⇒ CPU
Returns a new instance of CPU.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/warcorrespondent/reporters/cpu.rb', line 4 def initialize(args) @block = Proc.new do SystemInformation::cpu.map{ |cpu_id,data| data.map{ |type, value| {:identifier => "cpu:#{cpu_id.to_s}:#{type.to_s}", :value => value } } }.inject([]){|a,b| a+b} end super(args) end |