Class: Facter::Processors::OpenBSD
- Inherits:
-
BSD
- Object
- Base
- BSD
- Facter::Processors::OpenBSD
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_count ⇒ Object
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_speed ⇒ Object
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
|