CentralProcessorImpl
CentralProcessorImpl
provides an implementation of the CentralProcessor interface. This class retrieves information about the system's central processing unit (CPU), including its features, load, and performance metrics, leveraging the OSHI library.
Author
N7ghtm4r3
Parameters
The oshi.hardware.CentralProcessor instance used to fetch CPU details.
See also
Properties
contextSwitches
contains the total number of context switches that have occurred.
currentFreq
contains an array of current frequencies for each logical processor in hertz.
featureFlags
lists the CPU's supported features, such as instruction sets and extensions.
interrupts
contains the total number of interrupts that have occurred.
logicalProcessorCount
provides the number of logical processors in the system.
logicalProcessors
returns a list of logical processors, each representing a core or a thread.
physicalPackageCount
returns the number of physical processor packages in the system.
physicalProcessorCount
provides the number of physical processors (cores) in the system.
physicalProcessors
provides a list of physical processors, representing the physical cores in the system.
processorCaches
returns a list of processor caches, detailing cache levels, sizes, and types.
processorCpuLoadTicks
contains an array of tick counters for each logical processor, representing the CPU load distribution.
processorIdentifier
provides detailed information about the processor, such as vendor, name, stepping, and model.
systemCpuLoadTicks
contains an array of tick counters representing system-wide CPU load.
Functions
getProcessorCpuLoadBetweenTicks
calculates the CPU load for each logical processor, based on the difference between old and current tick counters.
getSystemCpuLoad
calculates the CPU load for the system over a specified delay.
getSystemCpuLoadBetweenTicks
calculates the system's CPU load as a percentage, based on the difference between old and current tick counters.
getSystemLoadAverage
retrieves the system's load average over a specified number of intervals.
Loads a list of logical processors with their detailed attributes.
Loads a list of physical processors with their detailed attributes.
Loads a list of processor caches with their attributes such as size and type.