Class: Kanrisuru::Remote::Cpu

Inherits:
Object
  • Object
show all
Defined in:
lib/kanrisuru/remote/cpu.rb

Instance Method Summary collapse

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_sizesObject



82
83
84
# File 'lib/kanrisuru/remote/cpu.rb', line 82

def address_sizes
  @cpu_architecture.address_sizes
end

#architectureObject



30
31
32
# File 'lib/kanrisuru/remote/cpu.rb', line 30

def architecture
  @cpu_architecture.architecture
end

#byte_orderObject



78
79
80
# File 'lib/kanrisuru/remote/cpu.rb', line 78

def byte_order
  @cpu_architecture.byte_order
end

#coresObject



38
39
40
# File 'lib/kanrisuru/remote/cpu.rb', line 38

def cores
  @cpu_architecture.cores
end

#cores_per_socketObject



54
55
56
# File 'lib/kanrisuru/remote/cpu.rb', line 54

def cores_per_socket
  @cpu_architecture.cores_per_socket
end

#countObject



46
47
48
# File 'lib/kanrisuru/remote/cpu.rb', line 46

def count
  @cpu_architecture.cores
end

#cpu_familyObject



66
67
68
# File 'lib/kanrisuru/remote/cpu.rb', line 66

def cpu_family
  @cpu_architecture.cpu_family
end

#cpu_max_mhzObject



90
91
92
# File 'lib/kanrisuru/remote/cpu.rb', line 90

def cpu_max_mhz
  @cpu_architecture.cpu_max_mhz
end

#cpu_mhzObject



86
87
88
# File 'lib/kanrisuru/remote/cpu.rb', line 86

def cpu_mhz
  @cpu_architecture.cpu_mhz
end

#cpu_min_mhzObject



94
95
96
# File 'lib/kanrisuru/remote/cpu.rb', line 94

def cpu_min_mhz
  @cpu_architecture.cpu_min_mhz
end

#flagsObject



106
107
108
# File 'lib/kanrisuru/remote/cpu.rb', line 106

def flags
  @cpu_architecture.flags
end

#hyperthreading?Boolean

Returns:

  • (Boolean)


110
111
112
# File 'lib/kanrisuru/remote/cpu.rb', line 110

def hyperthreading?
  threads_per_core > 1
end

#hypervisorObject



98
99
100
# File 'lib/kanrisuru/remote/cpu.rb', line 98

def hypervisor
  @cpu_architecture.hypervisor_vendor
end

#load_averageObject



14
15
16
# File 'lib/kanrisuru/remote/cpu.rb', line 14

def load_average
  @host.load_average.to_a
end

#load_average1Object



18
19
20
# File 'lib/kanrisuru/remote/cpu.rb', line 18

def load_average1
  load_average[0]
end

#load_average15Object



26
27
28
# File 'lib/kanrisuru/remote/cpu.rb', line 26

def load_average15
  load_average[2]
end

#load_average5Object



22
23
24
# File 'lib/kanrisuru/remote/cpu.rb', line 22

def load_average5
  load_average[1]
end

#modelObject



70
71
72
# File 'lib/kanrisuru/remote/cpu.rb', line 70

def model
  @cpu_architecture.model
end

#model_nameObject



74
75
76
# File 'lib/kanrisuru/remote/cpu.rb', line 74

def model_name
  @cpu_architecture.model_name
end

#numa_nodesObject



58
59
60
# File 'lib/kanrisuru/remote/cpu.rb', line 58

def numa_nodes
  @cpu_architecture.numa_nodes
end

#socketsObject



34
35
36
# File 'lib/kanrisuru/remote/cpu.rb', line 34

def sockets
  @cpu_architecture.sockets
end

#threads_per_coreObject



50
51
52
# File 'lib/kanrisuru/remote/cpu.rb', line 50

def threads_per_core
  @cpu_architecture.threads_per_core
end

#totalObject



42
43
44
# File 'lib/kanrisuru/remote/cpu.rb', line 42

def total
  @cpu_architecture.cores
end

#vendor_idObject



62
63
64
# File 'lib/kanrisuru/remote/cpu.rb', line 62

def vendor_id
  @cpu_architecture.vendor_id
end

#virtualization_typeObject



102
103
104
# File 'lib/kanrisuru/remote/cpu.rb', line 102

def virtualization_type
  @cpu_architecture.virtualization_type
end