Cpu
Kanrisuru::Remote::Cpu
class encapsulates the cpu information for a remote host.
Public Class Methods
new
Instantiates a new instance of cpu. Requires a host instance to read from.
cpu = Kanrisuru::Remote::Cpu.new(host)
cpu.cores
48
Public Instance Methods
load_average
Returns an array of the load average from the last 1 minute, 5 minutes, and 15 minutes. This is updated from the remote host each time the method is called.
cpu.load_average
[2.48, 2.74, 2.55]
load_average1
The last 1 minute load average for the cpu.
cpu.load_average1
2.46
load_average5
The last 5 minute load average for the cpu.
cpu.load_average5
2.65
load_average15
The last 15 minute load average for the cpu.
cpu.load_average15
2.51
sockets
The total number of physical sockets for the cpu chip.
cpu.sockets
2
cores
The total number of logical cores. This is the total number of cores in each socket and doubled if hyperthreading is turned on.
cpu.cores
48
total
Alias to cores
count
Alias to cores
threads_per_core
The total number of threads in a single core. This is usually indicative if hyperthreading is turned on or off.
cpu.threads_per_core
2
cores_per_socket
The number of physical cores in a single socket.
cpu.cores_per_socket
12
numa_nodes
The mode of the Non-uniform memory access (NUMA).
cpu.numa_nodes
2
vendor_id
The name of the vendor of the CPU chipset. NOTE: If the cpus differ per socket, there’s a known bug that only returns the value for the first CPU.
cpu.vendor_id
'GenuineIntel'
cpu_family
The numeric representation of the cpu family by the vendor. NOTE: If the cpus differ per socket, there’s a known bug that only returns the value for the first CPU.
host.cpu.cpu_family
6
model
The numeric representation fo the cpu model number by the vendor. NOTE: If the cpus differ per socket, there’s a known bug that only returns the value for the first CPU.
host.cpu.model
63
model_name
The name of the model of the cpu chipset. NOTE: If the cpus differ per socket, there’s a known bug that only returns the value for the first CPU.
cpu.model_name
"Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz"
byte_order
The order in which bytes are read by the processor. Can be Little Endian
or Big Endian
.
cpu.byte_order
"Little Endian"
address_sizes
Returns the number of phyiscal and virtual bits for the address space. Values only shown for physical servers, not virtual ones.
cpu.address_sizes
["46 bits physical", "48 bits virtual"]
cpu_mhz
The operating frequency of the cpu processor, in megahertz.
cpu.cpu_mhz
1694.195
cpu_max_mhz
The max operating frequency of the processor.
cpu.cpu_max_mhz
3300.0
cpu_min_mhz
The min operating frequency of the processor.
cpu.cpu_min_mhz
1200.0
hypervisor
The underlying hypervisor if the remote server is a virtual machine.
cpu2 = Kanrisuru::Remote::Cpu.new(host_virtual)
cpu2.hypervisor
'KVM'
virtualization_type
What type of virtualization type the virtualized machine is running on.
cpu2.virtualization_type
'full'
flags
Flags set on the processor.
cpu.flags
[
[ 0] "fpu",
[ 1] "vme",
[ 2] "de",
[ 3] .. [103],
[104] "pts",
[105] "md_clear",
[106] "flush_l1d"
]
hyperthreading?
If the cpu is set with hyperthreading on. If true, this means that each core is running two threads in the pipeline at the same time.
cpu.hyperthreading?
true