Sha256: 96ea564e97275a8491233c760b9844146330506c8223d00156cb76d641c1402c
Contents?: true
Size: 654 Bytes
Versions: 22
Compression:
Stored size: 654 Bytes
Contents
# frozen_string_literal: true module Facter module Resolvers class LoadAverages < BaseResolver init_resolver class << self private def post_resolve(fact_name, _options) @fact_list.fetch(fact_name) { read_load_averages(fact_name) } end def read_load_averages(fact_name) require 'facter/util/resolvers/ffi/load_averages' log.debug('loading cpu load averages') @fact_list[:load_averages] = %w[1m 5m 15m].zip(Facter::Util::Resolvers::Ffi::LoadAverages .read_load_averages).to_h @fact_list[fact_name] end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems