Class: OCI::Opsi::Models::AddmDbRecommendationsTimeSeriesSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb

Overview

ADDM recommendation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AddmDbRecommendationsTimeSeriesSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 123

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

  self.task_id = attributes[:'taskId'] if attributes[:'taskId']

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

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

  self.task_name = attributes[:'taskName'] if attributes[:'taskName']

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

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

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

  self.time_analysis_started = attributes[:'timeAnalysisStarted'] if attributes[:'timeAnalysisStarted']

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

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

  self.time_analysis_ended = attributes[:'timeAnalysisEnded'] if attributes[:'timeAnalysisEnded']

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

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

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

  self.analysis_db_time_in_secs = attributes[:'analysisDbTimeInSecs'] if attributes[:'analysisDbTimeInSecs']

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

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

  self.analysis_avg_active_sessions = attributes[:'analysisAvgActiveSessions'] if attributes[:'analysisAvgActiveSessions']

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

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

  self.max_benefit_percent = attributes[:'maxBenefitPercent'] if attributes[:'maxBenefitPercent']

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

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

  self.max_benefit_db_time_in_secs = attributes[:'maxBenefitDbTimeInSecs'] if attributes[:'maxBenefitDbTimeInSecs']

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

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

  self.max_benefit_avg_active_sessions = attributes[:'maxBenefitAvgActiveSessions'] if attributes[:'maxBenefitAvgActiveSessions']

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

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

  self.related_object = attributes[:'relatedObject'] if attributes[:'relatedObject']

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

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

Instance Attribute Details

#analysis_avg_active_sessionsFloat

DB avg active sessions for the snapshot

Returns:

  • (Float)


45
46
47
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 45

def analysis_avg_active_sessions
  @analysis_avg_active_sessions
end

#analysis_db_time_in_secsFloat

DB time in seconds for the snapshot

Returns:

  • (Float)


41
42
43
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 41

def analysis_db_time_in_secs
  @analysis_db_time_in_secs
end

#idString

[Required] The OCID of the Database insight.

Returns:

  • (String)


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

def id
  @id
end

#max_benefit_avg_active_sessionsFloat

Maximum estimated benefit in terms of average active sessions

Returns:

  • (Float)


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

def max_benefit_avg_active_sessions
  @max_benefit_avg_active_sessions
end

#max_benefit_db_time_in_secsFloat

Maximum estimated benefit in terms of seconds

Returns:

  • (Float)


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

def max_benefit_db_time_in_secs
  @max_benefit_db_time_in_secs
end

#max_benefit_percentFloat

Maximum estimated benefit in terms of percentage of total activity

Returns:

  • (Float)


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

def max_benefit_percent
  @max_benefit_percent
end


60
61
62
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 60

def related_object
  @related_object
end

#task_idInteger

[Required] Unique ADDM task id

Returns:

  • (Integer)


17
18
19
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 17

def task_id
  @task_id
end

#task_nameString

[Required] ADDM task name

Returns:

  • (String)


21
22
23
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 21

def task_name
  @task_name
end

#time_analysis_endedDateTime

End Timestamp of snapshot

Returns:

  • (DateTime)


33
34
35
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 33

def time_analysis_ended
  @time_analysis_ended
end

#time_analysis_startedDateTime

Start Timestamp of snapshot

Returns:

  • (DateTime)


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

def time_analysis_started
  @time_analysis_started
end

#timestampDateTime

[Required] Timestamp when recommendation was generated

Returns:

  • (DateTime)


25
26
27
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 25

def timestamp
  @timestamp
end

#typeString

Type of recommendation

Returns:

  • (String)


37
38
39
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 37

def type
  @type
end

Class Method Details

.attribute_mapObject

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



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 63

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'task_id': :'taskId',
    'task_name': :'taskName',
    'timestamp': :'timestamp',
    'time_analysis_started': :'timeAnalysisStarted',
    'time_analysis_ended': :'timeAnalysisEnded',
    'type': :'type',
    'analysis_db_time_in_secs': :'analysisDbTimeInSecs',
    'analysis_avg_active_sessions': :'analysisAvgActiveSessions',
    'max_benefit_percent': :'maxBenefitPercent',
    'max_benefit_db_time_in_secs': :'maxBenefitDbTimeInSecs',
    'max_benefit_avg_active_sessions': :'maxBenefitAvgActiveSessions',
    'related_object': :'relatedObject'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'task_id': :'Integer',
    'task_name': :'String',
    'timestamp': :'DateTime',
    'time_analysis_started': :'DateTime',
    'time_analysis_ended': :'DateTime',
    'type': :'String',
    'analysis_db_time_in_secs': :'Float',
    'analysis_avg_active_sessions': :'Float',
    'max_benefit_percent': :'Float',
    'max_benefit_db_time_in_secs': :'Float',
    'max_benefit_avg_active_sessions': :'Float',
    'related_object': :'OCI::Opsi::Models::RelatedObjectTypeDetails'
    # 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



203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 203

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

  self.class == other.class &&
    id == other.id &&
    task_id == other.task_id &&
    task_name == other.task_name &&
    timestamp == other.timestamp &&
    time_analysis_started == other.time_analysis_started &&
    time_analysis_ended == other.time_analysis_ended &&
    type == other.type &&
    analysis_db_time_in_secs == other.analysis_db_time_in_secs &&
    analysis_avg_active_sessions == other.analysis_avg_active_sessions &&
    max_benefit_percent == other.max_benefit_percent &&
    max_benefit_db_time_in_secs == other.max_benefit_db_time_in_secs &&
    max_benefit_avg_active_sessions == other.max_benefit_avg_active_sessions &&
    related_object == other.related_object
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



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 245

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


225
226
227
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 225

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



234
235
236
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 234

def hash
  [id, task_id, task_name, timestamp, time_analysis_started, time_analysis_ended, type, analysis_db_time_in_secs, analysis_avg_active_sessions, max_benefit_percent, max_benefit_db_time_in_secs, max_benefit_avg_active_sessions, related_object].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



278
279
280
281
282
283
284
285
286
287
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 278

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



272
273
274
# File 'lib/oci/opsi/models/addm_db_recommendations_time_series_summary.rb', line 272

def to_s
  to_hash.to_s
end