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.
-
#container_id ⇒ String
Container id if this process corresponds to a running container in the host.
-
#cpu_usage_in_seconds ⇒ Float
CPU usage in seconds.
-
#cpu_utilization_percent ⇒ Float
CPU utilization percentage.
-
#disk_bytes_read ⇒ Float
Bytes Read.
-
#disk_bytes_written ⇒ Float
Bytes Written.
-
#disk_iops ⇒ Float
IO Transactions per second.
-
#disk_iops_read ⇒ Float
Read transactions per second.
-
#disk_iops_written ⇒ Float
Write transactions per second.
-
#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
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 154 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'] self.container_id = attributes[:'containerId'] if attributes[:'containerId'] raise 'You cannot provide both :containerId and :container_id' if attributes.key?(:'containerId') && attributes.key?(:'container_id') self.container_id = attributes[:'container_id'] if attributes[:'container_id'] self.disk_bytes_read = attributes[:'diskBytesRead'] if attributes[:'diskBytesRead'] raise 'You cannot provide both :diskBytesRead and :disk_bytes_read' if attributes.key?(:'diskBytesRead') && attributes.key?(:'disk_bytes_read') self.disk_bytes_read = attributes[:'disk_bytes_read'] if attributes[:'disk_bytes_read'] self.disk_bytes_written = attributes[:'diskBytesWritten'] if attributes[:'diskBytesWritten'] raise 'You cannot provide both :diskBytesWritten and :disk_bytes_written' if attributes.key?(:'diskBytesWritten') && attributes.key?(:'disk_bytes_written') self.disk_bytes_written = attributes[:'disk_bytes_written'] if attributes[:'disk_bytes_written'] self.disk_iops_read = attributes[:'diskIopsRead'] if attributes[:'diskIopsRead'] raise 'You cannot provide both :diskIopsRead and :disk_iops_read' if attributes.key?(:'diskIopsRead') && attributes.key?(:'disk_iops_read') self.disk_iops_read = attributes[:'disk_iops_read'] if attributes[:'disk_iops_read'] self.disk_iops_written = attributes[:'diskIopsWritten'] if attributes[:'diskIopsWritten'] raise 'You cannot provide both :diskIopsWritten and :disk_iops_written' if attributes.key?(:'diskIopsWritten') && attributes.key?(:'disk_iops_written') self.disk_iops_written = attributes[:'disk_iops_written'] if attributes[:'disk_iops_written'] self.disk_iops = attributes[:'diskIops'] if attributes[:'diskIops'] raise 'You cannot provide both :diskIops and :disk_iops' if attributes.key?(:'diskIops') && attributes.key?(:'disk_iops') self.disk_iops = attributes[:'disk_iops'] if attributes[:'disk_iops'] end |
Instance Attribute Details
#command ⇒ String
Command line executed for the process
35 36 37 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 35 def command @command end |
#container_id ⇒ String
Container id if this process corresponds to a running container in the host
57 58 59 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 57 def container_id @container_id end |
#cpu_usage_in_seconds ⇒ Float
CPU usage in seconds
31 32 33 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 31 def cpu_usage_in_seconds @cpu_usage_in_seconds end |
#cpu_utilization_percent ⇒ Float
CPU utilization percentage
27 28 29 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 27 def cpu_utilization_percent @cpu_utilization_percent end |
#disk_bytes_read ⇒ Float
Bytes Read
61 62 63 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 61 def disk_bytes_read @disk_bytes_read end |
#disk_bytes_written ⇒ Float
Bytes Written
65 66 67 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 65 def disk_bytes_written @disk_bytes_written end |
#disk_iops ⇒ Float
IO Transactions per second
77 78 79 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 77 def disk_iops @disk_iops end |
#disk_iops_read ⇒ Float
Read transactions per second
69 70 71 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 69 def disk_iops_read @disk_iops_read end |
#disk_iops_written ⇒ Float
Write transactions per second
73 74 75 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 73 def disk_iops_written @disk_iops_written end |
#memory_utilization_percent ⇒ Float
Memory utilization percentage
23 24 25 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 23 def memory_utilization_percent @memory_utilization_percent end |
#physical_memory_in_mbs ⇒ Float
Physical memory in megabytes
43 44 45 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 43 def physical_memory_in_mbs @physical_memory_in_mbs end |
#pid ⇒ Float
process id
15 16 17 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 15 def pid @pid end |
#start_time ⇒ DateTime
Process Start Time Example: \"2020-03-31T00:00:00.000Z\"
49 50 51 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 49 def start_time @start_time end |
#total_processes ⇒ Float
Number of processes running at the time of collection
53 54 55 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 53 def total_processes @total_processes end |
#user_name ⇒ String
User that started the process
19 20 21 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 19 def user_name @user_name end |
#virtual_memory_in_mbs ⇒ Float
Virtual memory in megabytes
39 40 41 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 39 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.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 80 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', 'container_id': :'containerId', 'disk_bytes_read': :'diskBytesRead', 'disk_bytes_written': :'diskBytesWritten', 'disk_iops_read': :'diskIopsRead', 'disk_iops_written': :'diskIopsWritten', 'disk_iops': :'diskIops' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 106 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', 'container_id': :'String', 'disk_bytes_read': :'Float', 'disk_bytes_written': :'Float', 'disk_iops_read': :'Float', 'disk_iops_written': :'Float', 'disk_iops': :'Float' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 260 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 && container_id == other.container_id && disk_bytes_read == other.disk_bytes_read && disk_bytes_written == other.disk_bytes_written && disk_iops_read == other.disk_iops_read && disk_iops_written == other.disk_iops_written && disk_iops == other.disk_iops end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 307 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
287 288 289 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 287 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
296 297 298 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 296 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, container_id, disk_bytes_read, disk_bytes_written, disk_iops_read, disk_iops_written, disk_iops].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
340 341 342 343 344 345 346 347 348 349 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 340 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
334 335 336 |
# File 'lib/oci/opsi/models/host_top_processes.rb', line 334 def to_s to_hash.to_s end |