Class: OCI::Opsi::Models::HostTopProcesses
- Inherits:
-
HostPerformanceMetricGroup
- Object
- HostPerformanceMetricGroup
- OCI::Opsi::Models::HostTopProcesses
- Defined in:
- lib/oci/opsi/models/host_top_processes.rb
Overview
Top Processes metric for the host
Constant Summary
Constants inherited from HostPerformanceMetricGroup
OCI::Opsi::Models::HostPerformanceMetricGroup::METRIC_NAME_ENUM
Instance Attribute Summary collapse
-
#command ⇒ String
Command line executed for the process.
-
#cpu_usage_in_seconds ⇒ Float
CPU usage in seconds.
-
#cpu_utilization_percent ⇒ Float
CPU utilization percentage.
-
#memory_utilization_percent ⇒ Float
Memory utilization percentage.
-
#physical_memory_in_mbs ⇒ Float
Physical memory in megabytes.
-
#pid ⇒ Float
process id.
-
#start_time ⇒ DateTime
Process Start Time Example: `"2020-03-31T00:00:00.000Z"`.
-
#total_processes ⇒ Float
Number of processes running at the time of collection.
-
#user_name ⇒ String
User that started the process.
-
#virtual_memory_in_mbs ⇒ Float
Virtual memory in megabytes.
Attributes inherited from HostPerformanceMetricGroup
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ HostTopProcesses
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Methods inherited from HostPerformanceMetricGroup
Constructor Details
#initialize(attributes = {}) ⇒ HostTopProcesses
Initializes the object
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 111 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['metricName'] = 'HOST_TOP_PROCESSES' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.pid = attributes[:'pid'] if attributes[:'pid'] self.user_name = attributes[:'userName'] if attributes[:'userName'] raise 'You cannot provide both :userName and :user_name' if attributes.key?(:'userName') && attributes.key?(:'user_name') self.user_name = attributes[:'user_name'] if attributes[:'user_name'] self.memory_utilization_percent = attributes[:'memoryUtilizationPercent'] if attributes[:'memoryUtilizationPercent'] raise 'You cannot provide both :memoryUtilizationPercent and :memory_utilization_percent' if attributes.key?(:'memoryUtilizationPercent') && attributes.key?(:'memory_utilization_percent') self.memory_utilization_percent = attributes[:'memory_utilization_percent'] if attributes[:'memory_utilization_percent'] self.cpu_utilization_percent = attributes[:'cpuUtilizationPercent'] if attributes[:'cpuUtilizationPercent'] raise 'You cannot provide both :cpuUtilizationPercent and :cpu_utilization_percent' if attributes.key?(:'cpuUtilizationPercent') && attributes.key?(:'cpu_utilization_percent') self.cpu_utilization_percent = attributes[:'cpu_utilization_percent'] if attributes[:'cpu_utilization_percent'] self.cpu_usage_in_seconds = attributes[:'cpuUsageInSeconds'] if attributes[:'cpuUsageInSeconds'] raise 'You cannot provide both :cpuUsageInSeconds and :cpu_usage_in_seconds' if attributes.key?(:'cpuUsageInSeconds') && attributes.key?(:'cpu_usage_in_seconds') self.cpu_usage_in_seconds = attributes[:'cpu_usage_in_seconds'] if attributes[:'cpu_usage_in_seconds'] self.command = attributes[:'command'] if attributes[:'command'] self.virtual_memory_in_mbs = attributes[:'virtualMemoryInMBs'] if attributes[:'virtualMemoryInMBs'] raise 'You cannot provide both :virtualMemoryInMBs and :virtual_memory_in_mbs' if attributes.key?(:'virtualMemoryInMBs') && attributes.key?(:'virtual_memory_in_mbs') self.virtual_memory_in_mbs = attributes[:'virtual_memory_in_mbs'] if attributes[:'virtual_memory_in_mbs'] self.physical_memory_in_mbs = attributes[:'physicalMemoryInMBs'] if attributes[:'physicalMemoryInMBs'] raise 'You cannot provide both :physicalMemoryInMBs and :physical_memory_in_mbs' if attributes.key?(:'physicalMemoryInMBs') && attributes.key?(:'physical_memory_in_mbs') self.physical_memory_in_mbs = attributes[:'physical_memory_in_mbs'] if attributes[:'physical_memory_in_mbs'] self.start_time = attributes[:'startTime'] if attributes[:'startTime'] raise 'You cannot provide both :startTime and :start_time' if attributes.key?(:'startTime') && attributes.key?(:'start_time') self.start_time = attributes[:'start_time'] if attributes[:'start_time'] self.total_processes = attributes[:'totalProcesses'] if attributes[:'totalProcesses'] raise 'You cannot provide both :totalProcesses and :total_processes' if attributes.key?(:'totalProcesses') && attributes.key?(:'total_processes') self.total_processes = attributes[:'total_processes'] if attributes[:'total_processes'] end |
Instance Attribute Details
#command ⇒ String
Command line executed for the process
34 35 36 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 34 def command @command end |
#cpu_usage_in_seconds ⇒ Float
CPU usage in seconds
30 31 32 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 30 def cpu_usage_in_seconds @cpu_usage_in_seconds end |
#cpu_utilization_percent ⇒ Float
CPU utilization percentage
26 27 28 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 26 def cpu_utilization_percent @cpu_utilization_percent end |
#memory_utilization_percent ⇒ Float
Memory utilization percentage
22 23 24 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 22 def memory_utilization_percent @memory_utilization_percent end |
#physical_memory_in_mbs ⇒ Float
Physical memory in megabytes
42 43 44 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 42 def physical_memory_in_mbs @physical_memory_in_mbs end |
#pid ⇒ Float
process id
14 15 16 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 14 def pid @pid end |
#start_time ⇒ DateTime
Process Start Time Example: `"2020-03-31T00:00:00.000Z"`
48 49 50 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 48 def start_time @start_time end |
#total_processes ⇒ Float
Number of processes running at the time of collection
52 53 54 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 52 def total_processes @total_processes end |
#user_name ⇒ String
User that started the process
18 19 20 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 18 def user_name @user_name end |
#virtual_memory_in_mbs ⇒ Float
Virtual memory in megabytes
38 39 40 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 38 def virtual_memory_in_mbs @virtual_memory_in_mbs end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 55 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'metric_name': :'metricName', 'time_collected': :'timeCollected', 'pid': :'pid', 'user_name': :'userName', 'memory_utilization_percent': :'memoryUtilizationPercent', 'cpu_utilization_percent': :'cpuUtilizationPercent', 'cpu_usage_in_seconds': :'cpuUsageInSeconds', 'command': :'command', 'virtual_memory_in_mbs': :'virtualMemoryInMBs', 'physical_memory_in_mbs': :'physicalMemoryInMBs', 'start_time': :'startTime', 'total_processes': :'totalProcesses' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 75 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'metric_name': :'String', 'time_collected': :'DateTime', 'pid': :'Float', 'user_name': :'String', 'memory_utilization_percent': :'Float', 'cpu_utilization_percent': :'Float', 'cpu_usage_in_seconds': :'Float', 'command': :'String', 'virtual_memory_in_mbs': :'Float', 'physical_memory_in_mbs': :'Float', 'start_time': :'DateTime', 'total_processes': :'Float' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 181 def ==(other) return true if equal?(other) self.class == other.class && metric_name == other.metric_name && time_collected == other.time_collected && pid == other.pid && user_name == other.user_name && memory_utilization_percent == other.memory_utilization_percent && cpu_utilization_percent == other.cpu_utilization_percent && cpu_usage_in_seconds == other.cpu_usage_in_seconds && command == other.command && virtual_memory_in_mbs == other.virtual_memory_in_mbs && physical_memory_in_mbs == other.physical_memory_in_mbs && start_time == other.start_time && total_processes == other.total_processes end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 222 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
202 203 204 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 202 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
211 212 213 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 211 def hash [metric_name, time_collected, pid, user_name, memory_utilization_percent, cpu_utilization_percent, cpu_usage_in_seconds, command, virtual_memory_in_mbs, physical_memory_in_mbs, start_time, total_processes].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
255 256 257 258 259 260 261 262 263 264 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 255 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
249 250 251 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 249 def to_s to_hash.to_s end |