Class: OvirtMetrics::HostConfiguration
- Inherits:
-
OvirtHistory
- Object
- ActiveRecord::Base
- OvirtHistory
- OvirtMetrics::HostConfiguration
- Defined in:
- lib/ovirt_metrics/models/host_configuration.rb
Constant Summary collapse
- GHZ_REGEX =
/.*\@\s*(\d+\.\d+)GHz/
- MHZ_REGEX =
/.*\@\s*(\d+\.\d+)MHz/
Instance Method Summary collapse
Methods inherited from OvirtHistory
Instance Method Details
#speed_in_mhz ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ovirt_metrics/models/host_configuration.rb', line 9 def speed_in_mhz if self.cpu_model.respond_to?(:match) match = self.cpu_model.match(GHZ_REGEX) return (match[1].to_f * 1024) if match match = self.cpu_model.match(MHZ_REGEX) return match[1].to_f if match end return nil end |