Class | Sys::CPU |
In: |
lib/linux/sys/cpu.rb
lib/windows/sys/cpu.rb ext/bsd/bsd.c |
Parent: | Object |
VERSION | = | '0.6.4' | The version of the sys-cpu library. | |
VERSION | = | '0.6.4' | The version of the sys-cpu library | |
VERSION | = | 0.6.4 | The version of the sys-cpu library |
Returns the cpu‘s architecture. On most systems this will be identical to the CPU.machine method. On OpenBSD it will be identical to the CPU.model method.
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.
Returns the cpu‘s class type. On most systems this will be identical to the CPU.architecture method. On OpenBSD it will be identical to the CPU.model method.
Returns the number of cpu‘s on your system. Note that each core on multi-core systems are counted as a cpu, e.g. one dual core cpu would return 2, not 1.
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.
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 string indicating the type of processor, e.g. GenuineIntel.