Class: MistApi::StatsMxedgeCpuStat
- Defined in:
- lib/mist_api/models/stats_mxedge_cpu_stat.rb
Overview
CPU/core stats list
Instance Attribute Summary collapse
-
#cpus ⇒ Hash[String, CpuStat]
TODO: Write general description for this method.
-
#idle ⇒ Integer
Percentage of Idle, Idle/(Idle + Busy) since last sampling.
-
#interrupt ⇒ Integer
Percentage of Interrupt, (Irq + SoftIrq)/(Idle + Busy) since last sampling.
-
#system ⇒ Integer
Percentage of System, System/(Idle + Busy) since last sampling.
-
#usage ⇒ Integer
Percentage of load, Busy/(Idle + Busy) since last sampling.
-
#user ⇒ Integer
Percentage of User, User/(Idle + Busy) since last sampling.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(cpus = SKIP, idle = SKIP, interrupt = SKIP, system = SKIP, usage = SKIP, user = SKIP) ⇒ StatsMxedgeCpuStat
constructor
A new instance of StatsMxedgeCpuStat.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(cpus = SKIP, idle = SKIP, interrupt = SKIP, system = SKIP, usage = SKIP, user = SKIP) ⇒ StatsMxedgeCpuStat
Returns a new instance of StatsMxedgeCpuStat.
65 66 67 68 69 70 71 72 73 |
# File 'lib/mist_api/models/stats_mxedge_cpu_stat.rb', line 65 def initialize(cpus = SKIP, idle = SKIP, interrupt = SKIP, system = SKIP, usage = SKIP, user = SKIP) @cpus = cpus unless cpus == SKIP @idle = idle unless idle == SKIP @interrupt = interrupt unless interrupt == SKIP @system = system unless system == SKIP @usage = usage unless usage == SKIP @user = user unless user == SKIP end |
Instance Attribute Details
#cpus ⇒ Hash[String, CpuStat]
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/stats_mxedge_cpu_stat.rb', line 14 def cpus @cpus end |
#idle ⇒ Integer
Percentage of Idle, Idle/(Idle + Busy) since last sampling
18 19 20 |
# File 'lib/mist_api/models/stats_mxedge_cpu_stat.rb', line 18 def idle @idle end |
#interrupt ⇒ Integer
Percentage of Interrupt, (Irq + SoftIrq)/(Idle + Busy) since last sampling
22 23 24 |
# File 'lib/mist_api/models/stats_mxedge_cpu_stat.rb', line 22 def interrupt @interrupt end |
#system ⇒ Integer
Percentage of System, System/(Idle + Busy) since last sampling
26 27 28 |
# File 'lib/mist_api/models/stats_mxedge_cpu_stat.rb', line 26 def system @system end |
#usage ⇒ Integer
Percentage of load, Busy/(Idle + Busy) since last sampling
30 31 32 |
# File 'lib/mist_api/models/stats_mxedge_cpu_stat.rb', line 30 def usage @usage end |
#user ⇒ Integer
Percentage of User, User/(Idle + Busy) since last sampling
34 35 36 |
# File 'lib/mist_api/models/stats_mxedge_cpu_stat.rb', line 34 def user @user end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/mist_api/models/stats_mxedge_cpu_stat.rb', line 76 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. cpus = CpuStat.from_hash(hash['cpus']) if hash['cpus'] cpus = SKIP unless hash.key?('cpus') idle = hash.key?('idle') ? hash['idle'] : SKIP interrupt = hash.key?('interrupt') ? hash['interrupt'] : SKIP system = hash.key?('system') ? hash['system'] : SKIP usage = hash.key?('usage') ? hash['usage'] : SKIP user = hash.key?('user') ? hash['user'] : SKIP # Create object from extracted values. StatsMxedgeCpuStat.new(cpus, idle, interrupt, system, usage, user) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/mist_api/models/stats_mxedge_cpu_stat.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['cpus'] = 'cpus' @_hash['idle'] = 'idle' @_hash['interrupt'] = 'interrupt' @_hash['system'] = 'system' @_hash['usage'] = 'usage' @_hash['user'] = 'user' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/mist_api/models/stats_mxedge_cpu_stat.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/mist_api/models/stats_mxedge_cpu_stat.rb', line 49 def self.optionals %w[ cpus idle interrupt system usage user ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
106 107 108 109 110 111 |
# File 'lib/mist_api/models/stats_mxedge_cpu_stat.rb', line 106 def inspect class_name = self.class.name.split('::').last "<#{class_name} cpus: #{@cpus.inspect}, idle: #{@idle.inspect}, interrupt:"\ " #{@interrupt.inspect}, system: #{@system.inspect}, usage: #{@usage.inspect}, user:"\ " #{@user.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
99 100 101 102 103 |
# File 'lib/mist_api/models/stats_mxedge_cpu_stat.rb', line 99 def to_s class_name = self.class.name.split('::').last "<#{class_name} cpus: #{@cpus}, idle: #{@idle}, interrupt: #{@interrupt}, system:"\ " #{@system}, usage: #{@usage}, user: #{@user}>" end |