Class: SidekiqVigil::Check::Memory
- Defined in:
- lib/sidekiq_vigil/check/memory.rb
Instance Attribute Summary
Attributes inherited from Base
#api, #clock, #logger, #options, #storage
Instance Method Summary collapse
Methods inherited from Base
#check_name, #execute, #initialize
Constructor Details
This class inherits a constructor from SidekiqVigil::Check::Base
Instance Method Details
#call ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/sidekiq_vigil/check/memory.rb', line 6 def call return [skipped_result] if RUBY_PLATFORM.match?(/mswin|mingw/) keys = storage.scan("mem:*") return [empty_result] if keys.empty? keys.map do |key| process_id = key.delete_prefix(storage.prefix).delete_prefix("mem:") value_mb = storage.get("mem:#{process_id}").to_f / 1024 threshold_result( target: process_id, value: value_mb, warn: .fetch(:warn_mb, 1_500), critical: .fetch(:critical_mb, 2_500), message: format("%.1f MiB RSS", value_mb) ) end end |