Sha256: 54aee792bcb522f66684530d76f2e4fbfd5e61ff734a2c94cfb0e9c398ee21d5

Contents?: true

Size: 679 Bytes

Versions: 29

Compression:

Stored size: 679 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    module Aix
      class LoadAverages < BaseResolver
        @semaphore = Mutex.new
        @fact_list ||= {}
        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

29 entries across 29 versions & 1 rubygems

Version Path
facter-4.0.36 lib/facter/resolvers/aix/load_averages_resolver.rb
facter-4.0.35 lib/facter/resolvers/aix/load_averages_resolver.rb
facter-4.0.34 lib/facter/resolvers/aix/load_averages_resolver.rb
facter-4.0.33 lib/facter/resolvers/aix/load_averages_resolver.rb
facter-4.0.32 lib/facter/resolvers/aix/load_averages_resolver.rb
facter-4.0.31 lib/facter/resolvers/aix/load_averages_resolver.rb
facter-4.0.30 lib/facter/resolvers/aix/load_averages_resolver.rb
facter-4.0.29 lib/resolvers/aix/load_averages_resolver.rb
facter-4.0.28 lib/resolvers/aix/load_averages_resolver.rb
facter-4.0.26 lib/resolvers/aix/load_averages_resolver.rb
facter-4.0.25 lib/resolvers/aix/load_averages_resolver.rb
facter-4.0.24 lib/resolvers/aix/load_averages_resolver.rb
facter-4.0.23 lib/resolvers/aix/load_averages_resolver.rb
facter-4.0.22 lib/resolvers/aix/load_averages_resolver.rb
facter-4.0.21 lib/resolvers/aix/load_averages_resolver.rb
facter-4.0.20 lib/resolvers/aix/load_averages_resolver.rb
facter-4.0.19 lib/resolvers/aix/load_averages_resolver.rb
facter-4.0.18 lib/resolvers/aix/load_averages_resolver.rb
facter-4.0.17 lib/resolvers/aix/load_averages_resolver.rb
facter-4.0.16 lib/resolvers/aix/load_averages_resolver.rb