Class: SystemProcessors
- Inherits:
-
Object
- Object
- SystemProcessors
- Defined in:
- lib/processors.rb
Overview
Base and factory for processor probes
Direct Known Subclasses
LinuxSystemProcessors, MacSystemProcessors, WindowsSystemProcessors
Constant Summary collapse
- UNLIMITED =
-1
Instance Attribute Summary collapse
-
#architecture ⇒ Object
- DONE
-
enum x86_64, ARM64.
-
#core_count ⇒ Object
- DONE
-
number of total cores enabled.
-
#count ⇒ Object
- DONE
-
number of processors.
-
#family ⇒ Object
- DONE
-
family number.
-
#l2_cache ⇒ Object
- DONE
-
L2 cache in KB.
-
#l3_cache ⇒ Object
- DONE
-
L3 cache in KB.
-
#manufacturer ⇒ Object
- DONE
-
manufacturer descriptor: i.e.
-
#model ⇒ Object
- DONE
-
model/version number.
-
#model_name ⇒ Object
- DONE
-
model/version descriptor.
-
#speed ⇒ Object
- DONE
-
current speed in GigaHertz.
-
#thread_count ⇒ Object
- DONE
-
total number of threads.
Class Method Summary collapse
Instance Attribute Details
#architecture ⇒ Object
- DONE
-
enum x86_64, ARM64
10 11 12 |
# File 'lib/processors.rb', line 10 def architecture @architecture end |
#core_count ⇒ Object
- DONE
-
number of total cores enabled
11 12 13 |
# File 'lib/processors.rb', line 11 def core_count @core_count end |
#count ⇒ Object
- DONE
-
number of processors
9 10 11 |
# File 'lib/processors.rb', line 9 def count @count end |
#family ⇒ Object
- DONE
-
family number
18 19 20 |
# File 'lib/processors.rb', line 18 def family @family end |
#l2_cache ⇒ Object
- DONE
-
L2 cache in KB
13 14 15 |
# File 'lib/processors.rb', line 13 def l2_cache @l2_cache end |
#l3_cache ⇒ Object
- DONE
-
L3 cache in KB
14 15 16 |
# File 'lib/processors.rb', line 14 def l3_cache @l3_cache end |
#manufacturer ⇒ Object
- DONE
-
manufacturer descriptor: i.e. GenuineIntel
15 16 17 |
# File 'lib/processors.rb', line 15 def manufacturer @manufacturer end |
#model ⇒ Object
- DONE
-
model/version number
16 17 18 |
# File 'lib/processors.rb', line 16 def model @model end |
#model_name ⇒ Object
- DONE
-
model/version descriptor
17 18 19 |
# File 'lib/processors.rb', line 17 def model_name @model_name end |
#speed ⇒ Object
- DONE
-
current speed in GigaHertz
8 9 10 |
# File 'lib/processors.rb', line 8 def speed @speed end |
#thread_count ⇒ Object
- DONE
-
total number of threads
12 13 14 |
# File 'lib/processors.rb', line 12 def thread_count @thread_count end |
Class Method Details
.probe ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/processors.rb', line 20 def self.probe case RbConfig::CONFIG['host_os'] when /linux/ LinuxSystemProcessors.new when /darwin/ MacSystemProcessors.new when /cygwin|mswin|mingw32|mingw|bccwin|wince|emx/ WindowsSystemProcessors.new else RbConfig::CONFIG['host_os'] end end |