Class: WindowsSystemProcessors

Inherits:
SystemProcessors show all
Defined in:
lib/processors.rb

Overview

Processor probe for Windows systems noinspection RubyTooManyInstanceVariablesInspection

Constant Summary

Constants inherited from SystemProcessors

SystemProcessors::UNLIMITED

Instance Attribute Summary

Attributes inherited from SystemProcessors

#architecture, #core_count, #count, #family, #l2_cache, #l3_cache, #manufacturer, #model, #model_name, #speed, #thread_count

Instance Method Summary collapse

Methods inherited from SystemProcessors

probe

Constructor Details

#initializeWindowsSystemProcessors

Returns a new instance of WindowsSystemProcessors.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/processors.rb', line 83

def initialize
  # noinspection RubyResolve
  proc = wmic HardwareCategory::PROCESSORS
  @speed = proc['CurrentClockSpeed'].to_i.round(-1)
  @model_name = proc['Name']
  description = proc['Description'].split
  @family = description[2]
  @model = description[4]
  @count = proc['count']
  @core_count = proc['NumberOfCores'] * @count
  @thread_count = proc['ThreadCount'] * @count
  @l2_cache = proc['L2CacheSize'].to_i
  @l3_cache = proc['L3CacheSize'].to_i
  @manufacturer = proc['Manufacturer']
  @architecture = 'x86_64' if proc['AddressWidth'] == '64'
end