Sha256: 78e6686ed69d5a4ca5b126ebf0c5abc0ee59f9db30c8172af7be4dab5b47ee02

Contents?: true

Size: 351 Bytes

Versions: 53

Compression:

Stored size: 351 Bytes

Contents

module Bluepill
  module ProcessConditions
    class CpuUsage < ProcessCondition
      def initialize(options = {})
        @below = options[:below]
      end
      
      def run(pid)
        # third col in the ps axu output
        System.cpu_usage(pid).to_f
      end
      
      def check(value)
        value < @below
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 8 rubygems

Version Path
bluepill-0.0.46 lib/bluepill/process_conditions/cpu_usage.rb
bluepill-0.0.45 lib/bluepill/process_conditions/cpu_usage.rb
mwotton-bluepill-0.0.44 lib/bluepill/process_conditions/cpu_usage.rb
ra-bluepill-0.0.48 lib/bluepill/process_conditions/cpu_usage.rb
ra-bluepill-0.0.47 lib/bluepill/process_conditions/cpu_usage.rb
ra-bluepill-0.0.46 lib/bluepill/process_conditions/cpu_usage.rb
ra-bluepill-0.0.45 lib/bluepill/process_conditions/cpu_usage.rb
ra-bluepill-0.0.44 lib/bluepill/process_conditions/cpu_usage.rb
evented_bluepill-0.0.46 lib/bluepill/process_conditions/cpu_usage.rb
bluepill-0.0.44 lib/bluepill/process_conditions/cpu_usage.rb
sumskyi-bluepill-0.0.42.1 lib/bluepill/process_conditions/cpu_usage.rb
sumskyi-bluepill-0.0.42.0 lib/bluepill/process_conditions/cpu_usage.rb
bluepill-0.0.43 lib/bluepill/process_conditions/cpu_usage.rb
bluepill-0.0.42 lib/bluepill/process_conditions/cpu_usage.rb
bluepill-0.0.40 lib/bluepill/process_conditions/cpu_usage.rb
dylanvaughn-bluepill-0.0.40 lib/bluepill/process_conditions/cpu_usage.rb
dylanvaughn-bluepill-0.0.39 lib/bluepill/process_conditions/cpu_usage.rb
bluepill-0.0.39 lib/bluepill/process_conditions/cpu_usage.rb
bluepill-0.0.38 lib/bluepill/process_conditions/cpu_usage.rb
bluepill-0.0.37 lib/bluepill/process_conditions/cpu_usage.rb