Class: OCI::Opsi::Models::HostTopProcesses

Inherits:
HostPerformanceMetricGroup show all
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

Attributes inherited from HostPerformanceMetricGroup

#metric_name, #time_collected

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from HostPerformanceMetricGroup

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ HostTopProcesses

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :time_collected (DateTime)

    The value to assign to the #time_collected proprety

  • :pid (Float)

    The value to assign to the #pid property

  • :user_name (String)

    The value to assign to the #user_name property

  • :memory_utilization_percent (Float)

    The value to assign to the #memory_utilization_percent property

  • :cpu_utilization_percent (Float)

    The value to assign to the #cpu_utilization_percent property

  • :cpu_usage_in_seconds (Float)

    The value to assign to the #cpu_usage_in_seconds property

  • :command (String)

    The value to assign to the #command property

  • :virtual_memory_in_mbs (Float)

    The value to assign to the #virtual_memory_in_mbs property

  • :physical_memory_in_mbs (Float)

    The value to assign to the #physical_memory_in_mbs property

  • :start_time (DateTime)

    The value to assign to the #start_time property

  • :total_processes (Float)

    The value to assign to the #total_processes property

  • :container_id (String)

    The value to assign to the #container_id property

  • :disk_bytes_read (Float)

    The value to assign to the #disk_bytes_read property

  • :disk_bytes_written (Float)

    The value to assign to the #disk_bytes_written property

  • :disk_iops_read (Float)

    The value to assign to the #disk_iops_read property

  • :disk_iops_written (Float)

    The value to assign to the #disk_iops_written property

  • :disk_iops (Float)

    The value to assign to the #disk_iops property



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

#commandString

Command line executed for the process

Returns:

  • (String)


35
36
37
# File 'lib/oci/opsi/models/host_top_processes.rb', line 35

def command
  @command
end

#container_idString

Container id if this process corresponds to a running container in the host

Returns:

  • (String)


57
58
59
# File 'lib/oci/opsi/models/host_top_processes.rb', line 57

def container_id
  @container_id
end

#cpu_usage_in_secondsFloat

CPU usage in seconds

Returns:

  • (Float)


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_percentFloat

CPU utilization percentage

Returns:

  • (Float)


27
28
29
# File 'lib/oci/opsi/models/host_top_processes.rb', line 27

def cpu_utilization_percent
  @cpu_utilization_percent
end

#disk_bytes_readFloat

Bytes Read

Returns:

  • (Float)


61
62
63
# File 'lib/oci/opsi/models/host_top_processes.rb', line 61

def disk_bytes_read
  @disk_bytes_read
end

#disk_bytes_writtenFloat

Bytes Written

Returns:

  • (Float)


65
66
67
# File 'lib/oci/opsi/models/host_top_processes.rb', line 65

def disk_bytes_written
  @disk_bytes_written
end

#disk_iopsFloat

IO Transactions per second

Returns:

  • (Float)


77
78
79
# File 'lib/oci/opsi/models/host_top_processes.rb', line 77

def disk_iops
  @disk_iops
end

#disk_iops_readFloat

Read transactions per second

Returns:

  • (Float)


69
70
71
# File 'lib/oci/opsi/models/host_top_processes.rb', line 69

def disk_iops_read
  @disk_iops_read
end

#disk_iops_writtenFloat

Write transactions per second

Returns:

  • (Float)


73
74
75
# File 'lib/oci/opsi/models/host_top_processes.rb', line 73

def disk_iops_written
  @disk_iops_written
end

#memory_utilization_percentFloat

Memory utilization percentage

Returns:

  • (Float)


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_mbsFloat

Physical memory in megabytes

Returns:

  • (Float)


43
44
45
# File 'lib/oci/opsi/models/host_top_processes.rb', line 43

def physical_memory_in_mbs
  @physical_memory_in_mbs
end

#pidFloat

process id

Returns:

  • (Float)


15
16
17
# File 'lib/oci/opsi/models/host_top_processes.rb', line 15

def pid
  @pid
end

#start_timeDateTime

Process Start Time Example: \"2020-03-31T00:00:00.000Z\"

Returns:

  • (DateTime)


49
50
51
# File 'lib/oci/opsi/models/host_top_processes.rb', line 49

def start_time
  @start_time
end

#total_processesFloat

Number of processes running at the time of collection

Returns:

  • (Float)


53
54
55
# File 'lib/oci/opsi/models/host_top_processes.rb', line 53

def total_processes
  @total_processes
end

#user_nameString

User that started the process

Returns:

  • (String)


19
20
21
# File 'lib/oci/opsi/models/host_top_processes.rb', line 19

def user_name
  @user_name
end

#virtual_memory_in_mbsFloat

Virtual memory in megabytes

Returns:

  • (Float)


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_mapObject

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_typesObject

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.

Parameters:

  • other (Object)

    the other object to be compared



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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


287
288
289
# File 'lib/oci/opsi/models/host_top_processes.rb', line 287

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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_hashHash

Returns the object in the form of hash

Returns:

  • (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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation 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