Sha256: 0fb416da95f20c08f5f1878cf88719fccbd4454532b2e0befb57044c3ba6c61f
Contents?: true
Size: 662 Bytes
Versions: 1
Compression:
Stored size: 662 Bytes
Contents
# frozen_string_literal: true module ProxES class MemoryStatusCheck < StatusCheck def value # Currently checks the average. Can change it to check per node too children.values.inject(0.0) { |sum, el| sum + el } / children.count end def children @children ||= source_result['nodes']['nodes'].values.map do |node| [ node['name'], node['os']['mem']['used_percent'].to_f ] end.to_h end def check return true if required_value.blank? value < required_value.to_f end def formatted(val = nil) format('%.4f%% Average Usage', val || value) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
proxes-0.10.1 | lib/proxes/models/status_checks/memory_status_check.rb |