Class: CPUUsage

Inherits:
Object
  • Object
show all
Includes:
Watchman
Defined in:
lib/city_watch/watchmen/cpu_usage.rb

Class Method Summary collapse

Methods included from Watchman

#data, included

Class Method Details

.dataObject



7
8
9
10
11
12
# File 'lib/city_watch/watchmen/cpu_usage.rb', line 7

def self.data
	out = MPstat.data.select do |line|
		line[:run][/^Average:/]
	end
	out.length > 0 ? out.first.merge({:summary => [:usr, :idle, :sys]}) : {:nodata => true}
end