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



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
173
# File 'lib/oci/opsi/models/host_top_processes.rb', line 112

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

#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

#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

#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.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/opsi/models/host_top_processes.rb', line 56

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_typesObject

Attribute type mapping.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/oci/opsi/models/host_top_processes.rb', line 76

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.

Parameters:

  • other (Object)

    the other object to be compared



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/oci/opsi/models/host_top_processes.rb', line 182

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/oci/opsi/models/host_top_processes.rb', line 223

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


203
204
205
# File 'lib/oci/opsi/models/host_top_processes.rb', line 203

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



212
213
214
# File 'lib/oci/opsi/models/host_top_processes.rb', line 212

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_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



256
257
258
259
260
261
262
263
264
265
# File 'lib/oci/opsi/models/host_top_processes.rb', line 256

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



250
251
252
# File 'lib/oci/opsi/models/host_top_processes.rb', line 250

def to_s
  to_hash.to_s
end