HEX
Server: Apache
System: Linux shared178.accountservergroup.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User: somesolu (2995)
PHP: 8.2.33
Disabled: NONE
Upload Files
File: //usr/share/ruby/vendor_ruby/facter/physicalprocessorcount.rb
# Fact: physicalprocessorcount
#
# Purpose: Return the number of physical processors.
#
# Resolution:
#   Uses the physicalprocessorcount key of the processors structured
#   fact, which itself attempts to use sysfs to get the physical IDs of
#   the processors and falls back to `/proc/cpuinfo` and `physical id` if
#   sysfs is not available.
#
# Caveats:
#

Facter.add('physicalprocessorcount') do
  confine do
    !Facter.value(:processors).nil?
  end

  setcode do
    processors = Facter.value(:processors)
    if (physicalprocessorcount = processors["physicalcount"])
      physicalprocessorcount
    else
      nil
    end
  end
end