Class: OCI::DatabaseManagement::Models::OptimizerStatisticsCollectionAggregationSummary

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

Overview

The summary of the Optimizer Statistics Collection, which includes the aggregated number of tasks grouped by status.

Constant Summary collapse

GROUP_BY_ENUM =
[
  GROUP_BY_TASK_STATUS = 'TASK_STATUS'.freeze,
  GROUP_BY_TASK_OBJECTS_STATUS = 'TASK_OBJECTS_STATUS'.freeze,
  GROUP_BY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OptimizerStatisticsCollectionAggregationSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :group_by (String)

    The value to assign to the #group_by property

  • :time_start (DateTime)

    The value to assign to the #time_start property

  • :time_end (DateTime)

    The value to assign to the #time_end property

  • :pending (Integer)

    The value to assign to the #pending property

  • :in_progress (Integer)

    The value to assign to the #in_progress property

  • :completed (Integer)

    The value to assign to the #completed property

  • :failed (Integer)

    The value to assign to the #failed property

  • :skipped (Integer)

    The value to assign to the #skipped property

  • :timed_out (Integer)

    The value to assign to the #timed_out property

  • :unknown (Integer)

    The value to assign to the #unknown property

  • :total (Integer)

    The value to assign to the #total property



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
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 120

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

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

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

  self.time_start = attributes[:'timeStart'] if attributes[:'timeStart']

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

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

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

  self.in_progress = attributes[:'inProgress'] if attributes[:'inProgress']

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

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

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

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

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

  self.timed_out = attributes[:'timedOut'] if attributes[:'timedOut']

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

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

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

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

Instance Attribute Details

#completedInteger

The number of tasks or objects for which statistics gathering is completed.

Returns:

  • (Integer)


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

def completed
  @completed
end

#failedInteger

The number of tasks or objects for which statistics gathering failed.

Returns:

  • (Integer)


44
45
46
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 44

def failed
  @failed
end

#group_byString

The optimizer statistics tasks grouped by type.

Returns:

  • (String)


20
21
22
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 20

def group_by
  @group_by
end

#in_progressInteger

The number of tasks or objects for which statistics gathering is in progress.

Returns:

  • (Integer)


36
37
38
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 36

def in_progress
  @in_progress
end

#pendingInteger

The number of tasks or objects for which statistics are yet to be gathered.

Returns:

  • (Integer)


32
33
34
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 32

def pending
  @pending
end

#skippedInteger

The number of tasks or objects for which statistics gathering was skipped.

Returns:

  • (Integer)


48
49
50
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 48

def skipped
  @skipped
end

#time_endDateTime

Indicates the end of the hour as the statistics are aggregated per hour.

Returns:

  • (DateTime)


28
29
30
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 28

def time_end
  @time_end
end

#time_startDateTime

[Required] Indicates the start of the hour as the statistics are aggregated per hour.

Returns:

  • (DateTime)


24
25
26
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 24

def time_start
  @time_start
end

#timed_outInteger

The number of tasks or objects for which statistics gathering timed out.

Returns:

  • (Integer)


52
53
54
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 52

def timed_out
  @timed_out
end

#totalInteger

The total number of tasks or objects for which statistics collection is finished. This number is the sum of all the tasks or objects with various statuses: pending, inProgress, completed, failed, skipped, timedOut, and unknown.

Returns:

  • (Integer)


63
64
65
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 63

def total
  @total
end

#unknownInteger

The number of tasks or objects for which the status of statistics gathering is unknown.

Returns:

  • (Integer)


56
57
58
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 56

def unknown
  @unknown
end

Class Method Details

.attribute_mapObject

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



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 66

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'group_by': :'groupBy',
    'time_start': :'timeStart',
    'time_end': :'timeEnd',
    'pending': :'pending',
    'in_progress': :'inProgress',
    'completed': :'completed',
    'failed': :'failed',
    'skipped': :'skipped',
    'timed_out': :'timedOut',
    'unknown': :'unknown',
    'total': :'total'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 85

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'group_by': :'String',
    'time_start': :'DateTime',
    'time_end': :'DateTime',
    'pending': :'Integer',
    'in_progress': :'Integer',
    'completed': :'Integer',
    'failed': :'Integer',
    'skipped': :'Integer',
    'timed_out': :'Integer',
    'unknown': :'Integer',
    'total': :'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



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 189

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

  self.class == other.class &&
    group_by == other.group_by &&
    time_start == other.time_start &&
    time_end == other.time_end &&
    pending == other.pending &&
    in_progress == other.in_progress &&
    completed == other.completed &&
    failed == other.failed &&
    skipped == other.skipped &&
    timed_out == other.timed_out &&
    unknown == other.unknown &&
    total == other.total
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



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/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 229

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


209
210
211
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 209

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



218
219
220
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 218

def hash
  [group_by, time_start, time_end, pending, in_progress, completed, failed, skipped, timed_out, unknown, total].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



262
263
264
265
266
267
268
269
270
271
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 262

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



256
257
258
# File 'lib/oci/database_management/models/optimizer_statistics_collection_aggregation_summary.rb', line 256

def to_s
  to_hash.to_s
end