Class: Pimon::Probe::CpuFreq

Inherits:
Object
  • Object
show all
Defined in:
lib/pimon/probe/cpu_freq.rb

Class Method Summary collapse

Class Method Details

.check(date = Time.now) ⇒ Object



4
5
6
7
# File 'lib/pimon/probe/cpu_freq.rb', line 4

def self.check(date = Time.now)
  value = `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq`.to_i / 1000
  OpenStruct.new(date: date.strftime('%Y-%m-%d %H:%M:%S'), probe_name: 'cpu_freq', value: value, unit: unit)
end

.unitObject



9
10
11
# File 'lib/pimon/probe/cpu_freq.rb', line 9

def self.unit
  'Mhz'
end