Sha256: c2a85f33c1db754074c2edf495c9d9e85ec2e76761f5a413528ecc0746a780b1
Contents?: true
Size: 543 Bytes
Versions: 31
Compression:
Stored size: 543 Bytes
Contents
module LitmusPaper module Metric class CPULoad def initialize(weight, facter = Facter) @weight = weight @facter = facter end def current_health [@weight - (@weight * load_average / processor_count), 0].max end def processor_count @processor_count ||= @facter.value('processorcount').to_i end def load_average @facter.value('loadaverage').split(' ').first.to_f end def to_s "Metric::CPULoad(#{@weight})" end end end end
Version data entries
31 entries across 31 versions & 1 rubygems