Class: OCI::DatabaseManagement::Models::AwrDbWaitEventSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/models/awr_db_wait_event_summary.rb

Overview

The summary of the AWR wait event time series data for one event.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AwrDbWaitEventSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :time_begin (DateTime)

    The value to assign to the #time_begin property

  • :time_end (DateTime)

    The value to assign to the #time_end property

  • :waits_per_sec (Float)

    The value to assign to the #waits_per_sec property

  • :avg_wait_time_per_sec (Float)

    The value to assign to the #avg_wait_time_per_sec property

  • :avg_wait_time_per_wait (Float)

    The value to assign to the #avg_wait_time_per_wait property

  • :snapshot_id (Integer)

    The value to assign to the #snapshot_id property



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 85

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.name = attributes[:'name'] if attributes[:'name']

  self.time_begin = attributes[:'timeBegin'] if attributes[:'timeBegin']

  raise 'You cannot provide both :timeBegin and :time_begin' if attributes.key?(:'timeBegin') && attributes.key?(:'time_begin')

  self.time_begin = attributes[:'time_begin'] if attributes[:'time_begin']

  self.time_end = attributes[:'timeEnd'] if attributes[:'timeEnd']

  raise 'You cannot provide both :timeEnd and :time_end' if attributes.key?(:'timeEnd') && attributes.key?(:'time_end')

  self.time_end = attributes[:'time_end'] if attributes[:'time_end']

  self.waits_per_sec = attributes[:'waitsPerSec'] if attributes[:'waitsPerSec']

  raise 'You cannot provide both :waitsPerSec and :waits_per_sec' if attributes.key?(:'waitsPerSec') && attributes.key?(:'waits_per_sec')

  self.waits_per_sec = attributes[:'waits_per_sec'] if attributes[:'waits_per_sec']

  self.avg_wait_time_per_sec = attributes[:'avgWaitTimePerSec'] if attributes[:'avgWaitTimePerSec']

  raise 'You cannot provide both :avgWaitTimePerSec and :avg_wait_time_per_sec' if attributes.key?(:'avgWaitTimePerSec') && attributes.key?(:'avg_wait_time_per_sec')

  self.avg_wait_time_per_sec = attributes[:'avg_wait_time_per_sec'] if attributes[:'avg_wait_time_per_sec']

  self.avg_wait_time_per_wait = attributes[:'avgWaitTimePerWait'] if attributes[:'avgWaitTimePerWait']

  raise 'You cannot provide both :avgWaitTimePerWait and :avg_wait_time_per_wait' if attributes.key?(:'avgWaitTimePerWait') && attributes.key?(:'avg_wait_time_per_wait')

  self.avg_wait_time_per_wait = attributes[:'avg_wait_time_per_wait'] if attributes[:'avg_wait_time_per_wait']

  self.snapshot_id = attributes[:'snapshotId'] if attributes[:'snapshotId']

  raise 'You cannot provide both :snapshotId and :snapshot_id' if attributes.key?(:'snapshotId') && attributes.key?(:'snapshot_id')

  self.snapshot_id = attributes[:'snapshot_id'] if attributes[:'snapshot_id']
end

Instance Attribute Details

#avg_wait_time_per_secFloat

The average wait time per second.

Returns:

  • (Float)


29
30
31
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 29

def avg_wait_time_per_sec
  @avg_wait_time_per_sec
end

#avg_wait_time_per_waitFloat

The average wait time in milliseconds per wait.

Returns:

  • (Float)


33
34
35
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 33

def avg_wait_time_per_wait
  @avg_wait_time_per_wait
end

#nameString

[Required] The name of the event.

Returns:

  • (String)


13
14
15
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 13

def name
  @name
end

#snapshot_idInteger

The ID of the snapshot. The snapshot ID is not the OCID. It can be retrieved from the following endpoint: /managedDatabases/managedDatabaseId/awrDbs/awrDbId/awrDbSnapshots

Returns:

  • (Integer)


40
41
42
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 40

def snapshot_id
  @snapshot_id
end

#time_beginDateTime

The begin time of the wait event.

Returns:

  • (DateTime)


17
18
19
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 17

def time_begin
  @time_begin
end

#time_endDateTime

The end time of the wait event.

Returns:

  • (DateTime)


21
22
23
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 21

def time_end
  @time_end
end

#waits_per_secFloat

The wait count per second.

Returns:

  • (Float)


25
26
27
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 25

def waits_per_sec
  @waits_per_sec
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 43

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'time_begin': :'timeBegin',
    'time_end': :'timeEnd',
    'waits_per_sec': :'waitsPerSec',
    'avg_wait_time_per_sec': :'avgWaitTimePerSec',
    'avg_wait_time_per_wait': :'avgWaitTimePerWait',
    'snapshot_id': :'snapshotId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 58

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'time_begin': :'DateTime',
    'time_end': :'DateTime',
    'waits_per_sec': :'Float',
    'avg_wait_time_per_sec': :'Float',
    'avg_wait_time_per_wait': :'Float',
    'snapshot_id': :'Integer'
    # 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



137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 137

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    name == other.name &&
    time_begin == other.time_begin &&
    time_end == other.time_end &&
    waits_per_sec == other.waits_per_sec &&
    avg_wait_time_per_sec == other.avg_wait_time_per_sec &&
    avg_wait_time_per_wait == other.avg_wait_time_per_wait &&
    snapshot_id == other.snapshot_id
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



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 173

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


153
154
155
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 153

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



162
163
164
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 162

def hash
  [name, time_begin, time_end, waits_per_sec, avg_wait_time_per_sec, avg_wait_time_per_wait, snapshot_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



206
207
208
209
210
211
212
213
214
215
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 206

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



200
201
202
# File 'lib/oci/database_management/models/awr_db_wait_event_summary.rb', line 200

def to_s
  to_hash.to_s
end