Sha256: b0406ed26eb13c5e0f7b227f4d9fb2224bd6823ff1293b9f584c37c379b1f7cf

Contents?: true

Size: 645 Bytes

Versions: 4

Compression:

Stored size: 645 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    module Aix
      class LoadAverages < BaseResolver
        init_resolver

        class << self
          private

          def post_resolve(fact_name)
            @fact_list.fetch(fact_name) { read_load_averages(fact_name) }
          end

          def read_load_averages(fact_name)
            require_relative 'ffi/ffi_helper'
            @fact_list[:load_averages] = {}.tap do |h|
              h['1m'], h['5m'], h['15m'] = Facter::Aix::FfiHelper.read_load_averages
            end

            @fact_list[fact_name]
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facter-4.0.49 lib/facter/resolvers/aix/load_averages.rb
facter-4.0.48 lib/facter/resolvers/aix/load_averages.rb
facter-4.0.47 lib/facter/resolvers/aix/load_averages_resolver.rb
facter-4.0.46 lib/facter/resolvers/aix/load_averages_resolver.rb