Sha256: bbe1a8dac6094c8b1720f95dd3acf73bcdf53469425303d80712de0a54e361b3
Contents?: true
Size: 630 Bytes
Versions: 13
Compression:
Stored size: 630 Bytes
Contents
# frozen_string_literal: true module Facter module Resolvers module Bsd 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] = %w[1m 5m 15m].zip(Facter::Bsd::FfiHelper.read_load_averages).to_h @fact_list[fact_name] end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems