Sha256: 516d4ad546ff0e4112b4e4ec32367d7c4bf5e21b8a03b797b97b1a9a672f583f

Contents?: true

Size: 553 Bytes

Versions: 3

Compression:

Stored size: 553 Bytes

Contents

# frozen_string_literal: true

module Facts
  module El
    module Memory
      module Swap
        class AvailableBytes
          FACT_NAME = 'memory.swap.available_bytes'
          ALIASES = 'swapfree_mb'

          def call_the_resolver
            fact_value = Facter::Resolvers::Linux::Memory.resolve(:swap_free)
            [Facter::ResolvedFact.new(FACT_NAME, fact_value),
             Facter::ResolvedFact.new(ALIASES, fact_value ? (fact_value / (1024.0 * 1024.0)).round(2) : nil, :legacy)]
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facter-4.0.12 lib/facts/el/memory/swap/available_bytes.rb
facter-4.0.11 lib/facts/el/memory/swap/available_bytes.rb
facter-4.0.10.pre lib/facts/el/memory/swap/available_bytes.rb