class WindowsSystemProcessors

Processor probe for Windows systems noinspection RubyTooManyInstanceVariablesInspection

Public Class Methods

new() click to toggle source
# 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