Class: OCI::Opsi::Models::AwrDatabaseWaitEventSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/opsi/models/awr_database_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 = {}) ⇒ AwrDatabaseWaitEventSummary

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

  • :snapshot_identifier (Integer)

    The value to assign to the #snapshot_identifier property



78
79
80
81
82
83
84
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
# File 'lib/oci/opsi/models/awr_database_wait_event_summary.rb', line 78

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.snapshot_identifier = attributes[:'snapshotIdentifier'] if attributes[:'snapshotIdentifier']

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

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

Instance Attribute Details

#avg_wait_time_per_secFloat

The average wait time per second.

Returns:

  • (Float)


29
30
31
# File 'lib/oci/opsi/models/awr_database_wait_event_summary.rb', line 29

def avg_wait_time_per_sec
  @avg_wait_time_per_sec
end

#nameString

[Required] The name of the event.

Returns:

  • (String)


13
14
15
# File 'lib/oci/opsi/models/awr_database_wait_event_summary.rb', line 13

def name
  @name
end

#snapshot_identifierInteger

The ID of the snapshot. The snapshot identifier is not the OCID. It can be retrieved from the following endpoint: /awrHubs/awrHubId/awrDatabaseSnapshots

Returns:

  • (Integer)


36
37
38
# File 'lib/oci/opsi/models/awr_database_wait_event_summary.rb', line 36

def snapshot_identifier
  @snapshot_identifier
end

#time_beginDateTime

The begin time of the wait event.

Returns:

  • (DateTime)


17
18
19
# File 'lib/oci/opsi/models/awr_database_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/opsi/models/awr_database_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/opsi/models/awr_database_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.



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/oci/opsi/models/awr_database_wait_event_summary.rb', line 39

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',
    'snapshot_identifier': :'snapshotIdentifier'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/oci/opsi/models/awr_database_wait_event_summary.rb', line 53

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',
    'snapshot_identifier': :'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



124
125
126
127
128
129
130
131
132
133
134
# File 'lib/oci/opsi/models/awr_database_wait_event_summary.rb', line 124

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 &&
    snapshot_identifier == other.snapshot_identifier
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



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/oci/opsi/models/awr_database_wait_event_summary.rb', line 159

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


139
140
141
# File 'lib/oci/opsi/models/awr_database_wait_event_summary.rb', line 139

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



148
149
150
# File 'lib/oci/opsi/models/awr_database_wait_event_summary.rb', line 148

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



192
193
194
195
196
197
198
199
200
201
# File 'lib/oci/opsi/models/awr_database_wait_event_summary.rb', line 192

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



186
187
188
# File 'lib/oci/opsi/models/awr_database_wait_event_summary.rb', line 186

def to_s
  to_hash.to_s
end