Sha256: 98f41a731809bdcce6df4196295164ebed0b6039142027d514fba51b931a9889

Contents?: true

Size: 355 Bytes

Versions: 18

Compression:

Stored size: 355 Bytes

Contents

module Bluepill
  module ProcessConditions
    class MemUsage < ProcessCondition
      def initialize(options = {})
        @below = options[:below]
      end
      
      def run(pid)
        # rss is on the 5th col
        System.memory_usage(pid).to_f
      end
      
      def check(value)
        value.kilobytes < @below
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
bluepill-0.0.23 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.22 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.21 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.20 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.19 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.18 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.17 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.16 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.15 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.14 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.13 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.12 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.11 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.10 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.9 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.8 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.7 lib/bluepill/process_conditions/mem_usage.rb
bluepill-0.0.6 lib/bluepill/process_conditions/mem_usage.rb