Class: Facter::Processors::OpenBSD

Inherits:
BSD
  • Object
show all
Defined in:
lib/facter/processors/os.rb

Instance Method Summary collapse

Methods inherited from BSD

#get_processor_count

Methods inherited from Base

#get_processor_count, #get_processor_list

Instance Method Details

#get_physical_processor_countObject



177
178
179
# File 'lib/facter/processors/os.rb', line 177

def get_physical_processor_count
  Facter::Util::POSIX.sysctl("hw.ncpufound").to_i
end

#get_processor_speedObject



181
182
183
184
185
186
187
188
189
# File 'lib/facter/processors/os.rb', line 181

def get_processor_speed
  speed = Facter::Util::POSIX.sysctl("hw.cpuspeed").to_i
  if speed < 1000
    "#{speed} MHz"
  else
    speed = speed.to_f / 1000
    "#{(speed * 100).round.to_f / 100.0} GHz"
  end
end