Class: Kanrisuru::Remote::Cpu
- Inherits:
-
Object
- Object
- Kanrisuru::Remote::Cpu
- Defined in:
- lib/kanrisuru/remote/cpu.rb
Instance Method Summary collapse
- #address_sizes ⇒ Object
- #architecture ⇒ Object
- #byte_order ⇒ Object
- #cores ⇒ Object
- #cores_per_socket ⇒ Object
- #count ⇒ Object
- #cpu_family ⇒ Object
- #cpu_max_mhz ⇒ Object
- #cpu_mhz ⇒ Object
- #cpu_min_mhz ⇒ Object
- #flags ⇒ Object
- #hyperthreading? ⇒ Boolean
- #hypervisor ⇒ Object
-
#initialize(host) ⇒ Cpu
constructor
A new instance of Cpu.
- #load_average ⇒ Object
- #load_average1 ⇒ Object
- #load_average15 ⇒ Object
- #load_average5 ⇒ Object
- #model ⇒ Object
- #model_name ⇒ Object
- #numa_nodes ⇒ Object
- #sockets ⇒ Object
- #threads_per_core ⇒ Object
- #total ⇒ Object
- #vendor_id ⇒ Object
- #virtualization_type ⇒ Object
Constructor Details
#initialize(host) ⇒ Cpu
Returns a new instance of Cpu.
6 7 8 9 10 11 12 |
# File 'lib/kanrisuru/remote/cpu.rb', line 6 def initialize(host) @host = host raise 'Not implemented' unless @host.os && @host.os.kernel == 'Linux' initialize_linux end |
Instance Method Details
#address_sizes ⇒ Object
82 83 84 |
# File 'lib/kanrisuru/remote/cpu.rb', line 82 def address_sizes @cpu_architecture.address_sizes end |
#architecture ⇒ Object
30 31 32 |
# File 'lib/kanrisuru/remote/cpu.rb', line 30 def architecture @cpu_architecture.architecture end |
#byte_order ⇒ Object
78 79 80 |
# File 'lib/kanrisuru/remote/cpu.rb', line 78 def byte_order @cpu_architecture.byte_order end |
#cores ⇒ Object
38 39 40 |
# File 'lib/kanrisuru/remote/cpu.rb', line 38 def cores @cpu_architecture.cores end |
#cores_per_socket ⇒ Object
54 55 56 |
# File 'lib/kanrisuru/remote/cpu.rb', line 54 def cores_per_socket @cpu_architecture.cores_per_socket end |
#count ⇒ Object
46 47 48 |
# File 'lib/kanrisuru/remote/cpu.rb', line 46 def count @cpu_architecture.cores end |
#cpu_family ⇒ Object
66 67 68 |
# File 'lib/kanrisuru/remote/cpu.rb', line 66 def cpu_family @cpu_architecture.cpu_family end |
#cpu_max_mhz ⇒ Object
90 91 92 |
# File 'lib/kanrisuru/remote/cpu.rb', line 90 def cpu_max_mhz @cpu_architecture.cpu_max_mhz end |
#cpu_mhz ⇒ Object
86 87 88 |
# File 'lib/kanrisuru/remote/cpu.rb', line 86 def cpu_mhz @cpu_architecture.cpu_mhz end |
#cpu_min_mhz ⇒ Object
94 95 96 |
# File 'lib/kanrisuru/remote/cpu.rb', line 94 def cpu_min_mhz @cpu_architecture.cpu_min_mhz end |
#flags ⇒ Object
106 107 108 |
# File 'lib/kanrisuru/remote/cpu.rb', line 106 def flags @cpu_architecture.flags end |
#hyperthreading? ⇒ Boolean
110 111 112 |
# File 'lib/kanrisuru/remote/cpu.rb', line 110 def hyperthreading? threads_per_core > 1 end |
#hypervisor ⇒ Object
98 99 100 |
# File 'lib/kanrisuru/remote/cpu.rb', line 98 def hypervisor @cpu_architecture.hypervisor_vendor end |
#load_average ⇒ Object
14 15 16 |
# File 'lib/kanrisuru/remote/cpu.rb', line 14 def load_average @host.load_average.to_a end |
#load_average1 ⇒ Object
18 19 20 |
# File 'lib/kanrisuru/remote/cpu.rb', line 18 def load_average1 load_average[0] end |
#load_average15 ⇒ Object
26 27 28 |
# File 'lib/kanrisuru/remote/cpu.rb', line 26 def load_average15 load_average[2] end |
#load_average5 ⇒ Object
22 23 24 |
# File 'lib/kanrisuru/remote/cpu.rb', line 22 def load_average5 load_average[1] end |
#model ⇒ Object
70 71 72 |
# File 'lib/kanrisuru/remote/cpu.rb', line 70 def model @cpu_architecture.model end |
#model_name ⇒ Object
74 75 76 |
# File 'lib/kanrisuru/remote/cpu.rb', line 74 def model_name @cpu_architecture.model_name end |
#numa_nodes ⇒ Object
58 59 60 |
# File 'lib/kanrisuru/remote/cpu.rb', line 58 def numa_nodes @cpu_architecture.numa_nodes end |
#sockets ⇒ Object
34 35 36 |
# File 'lib/kanrisuru/remote/cpu.rb', line 34 def sockets @cpu_architecture.sockets end |
#threads_per_core ⇒ Object
50 51 52 |
# File 'lib/kanrisuru/remote/cpu.rb', line 50 def threads_per_core @cpu_architecture.threads_per_core end |
#total ⇒ Object
42 43 44 |
# File 'lib/kanrisuru/remote/cpu.rb', line 42 def total @cpu_architecture.cores end |
#vendor_id ⇒ Object
62 63 64 |
# File 'lib/kanrisuru/remote/cpu.rb', line 62 def vendor_id @cpu_architecture.vendor_id end |
#virtualization_type ⇒ Object
102 103 104 |
# File 'lib/kanrisuru/remote/cpu.rb', line 102 def virtualization_type @cpu_architecture.virtualization_type end |