Class | Sys::CPU |
In: |
lib/linux/sys/cpu.rb
lib/unix/sys/cpu.rb lib/windows/sys/cpu.rb lib/unix/sys/cpu.rb lib/unix/sys/cpu.rb |
Parent: | Object |
Encapsulates system CPU information
VERSION | = | '0.7.0' | The version of the sys-cpu library. | |
VERSION | = | '0.7.0' | The version of the sys-cpu library | |
CTL_HW | = | 6 | ||
HW_MACHINE | = | 1 | ||
HW_MODEL | = | 2 | ||
HW_NCPU | = | 3 | ||
HW_CPU_FREQ | = | 15 | ||
HW_MACHINE_ARCH | = | 11 | ||
HW_MACHINE_ARCH | = | 12 | ||
SI_MACHINE | = | 5 | ||
SI_ARCHITECTURE | = | 6 | ||
SC_NPROCESSORS_ONLN | = | 15 | ||
P_OFFLINE | = | 1 | ||
P_ONLINE | = | 2 | ||
P_FAULTED | = | 4 | ||
P_POWEROFF | = | 5 | ||
P_NOINTR | = | 6 | ||
P_SPARE | = | 7 | ||
CPU_ARCH_ABI64 | = | 0x01000000 | ||
CPU_TYPE_X86 | = | 7 | ||
CPU_TYPE_X86_64 | = | (CPU_TYPE_X86 | CPU_ARCH_ABI64) | ||
CPU_TYPE_SPARC | = | 14 | ||
CPU_TYPE_POWERPC | = | 18 | ||
CPU_TYPE_POWERPC64 | = | CPU_TYPE_POWERPC | CPU_ARCH_ABI64 | ||
VERSION | = | '0.7.0' | The version of the sys-cpu library | |
VERSION | = | '0.7.0' | The version of the sys-cpu library | |
CTL_HW | = | 6 | ||
HW_MACHINE | = | 1 | ||
HW_MODEL | = | 2 | ||
HW_NCPU | = | 3 | ||
HW_CPU_FREQ | = | 15 | ||
HW_MACHINE_ARCH | = | 11 | ||
HW_MACHINE_ARCH | = | 12 | ||
SI_MACHINE | = | 5 | ||
SI_ARCHITECTURE | = | 6 | ||
SC_NPROCESSORS_ONLN | = | 15 | ||
P_OFFLINE | = | 1 | ||
P_ONLINE | = | 2 | ||
P_FAULTED | = | 4 | ||
P_POWEROFF | = | 5 | ||
P_NOINTR | = | 6 | ||
P_SPARE | = | 7 | ||
CPU_ARCH_ABI64 | = | 0x01000000 | ||
CPU_TYPE_X86 | = | 7 | ||
CPU_TYPE_X86_64 | = | (CPU_TYPE_X86 | CPU_ARCH_ABI64) | ||
CPU_TYPE_SPARC | = | 14 | ||
CPU_TYPE_POWERPC | = | 18 | ||
CPU_TYPE_POWERPC64 | = | CPU_TYPE_POWERPC | CPU_ARCH_ABI64 | ||
VERSION | = | '0.7.0' | The version of the sys-cpu library | |
CTL_HW | = | 6 | ||
HW_MACHINE | = | 1 | ||
HW_MODEL | = | 2 | ||
HW_NCPU | = | 3 | ||
HW_CPU_FREQ | = | 15 | ||
HW_MACHINE_ARCH | = | 11 | ||
HW_MACHINE_ARCH | = | 12 | ||
SI_MACHINE | = | 5 | ||
SI_ARCHITECTURE | = | 6 | ||
SC_NPROCESSORS_ONLN | = | 15 | ||
P_OFFLINE | = | 1 | ||
P_ONLINE | = | 2 | ||
P_FAULTED | = | 4 | ||
P_POWEROFF | = | 5 | ||
P_NOINTR | = | 6 | ||
P_SPARE | = | 7 | ||
CPU_ARCH_ABI64 | = | 0x01000000 | ||
CPU_TYPE_X86 | = | 7 | ||
CPU_TYPE_X86_64 | = | (CPU_TYPE_X86 | CPU_ARCH_ABI64) | ||
CPU_TYPE_SPARC | = | 14 | ||
CPU_TYPE_POWERPC | = | 18 | ||
CPU_TYPE_POWERPC64 | = | CPU_TYPE_POWERPC | CPU_ARCH_ABI64 |
Returns the host CPU‘s architecture, or nil if it cannot be determined.
Returns a hash of arrays that contain the number of seconds that the system spent in user mode, user mode with low priority (nice), system mode, and the idle task, respectively.
Returns an integer indicating the speed (i.e. frequency in Mhz) of cpu_num on host, or the localhost if no host is specified. If cpu_num +1 is greater than the number of cpu‘s on your system or this call fails for any other reason, a Error is raised.
Returns the load capacity for cpu_num on host, or the localhost if no host is specified, averaged to the last second. Processor loading refers to the total computing burden for each processor at one time.
Note that this attribute is actually the LoadPercentage. I may use one of the Win32_Perf* classes in the future.
In block form, yields a CPUStruct for each CPU on the system. In non-block form, returns an Array of CPUStruct‘s.
The exact members of the struct vary on Linux systems.
Returns a CPUStruct for each CPU on host, or the localhost if no host is specified. A CPUStruct contains the following members:
Note that not all of these members will necessarily be defined.