Class: OCI::Opsi::Models::SqlInsightAggregation

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

Overview

Represents a SQL Insight.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SqlInsightAggregation

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :text (String)

    The value to assign to the #text property

  • :values (Array<Integer>)

    The value to assign to the #values property

  • :category (String)

    The value to assign to the #category property



87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/oci/opsi/models/sql_insight_aggregation.rb', line 87

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

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

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

Instance Attribute Details

#categoryString

[Required] Insight category. It would be one of the following DEGRADING, VARIANT, INEFFICIENT, CHANGING_PLANS, IMPROVING, DEGRADING_VARIANT, DEGRADING_INEFFICIENT, DEGRADING_CHANGING_PLANS, DEGRADING_INCREASING_IO, DEGRADING_INCREASING_CPU, DEGRADING_INCREASING_INEFFICIENT_WAIT, DEGRADING_CHANGING_PLANS_AND_INCREASING_IO, DEGRADING_CHANGING_PLANS_AND_INCREASING_CPU, DEGRADING_CHANGING_PLANS_AND_INCREASING_INEFFICIENT_WAIT,VARIANT_INEFFICIENT, VARIANT_CHANGING_PLANS, VARIANT_INCREASING_IO, VARIANT_INCREASING_CPU, VARIANT_INCREASING_INEFFICIENT_WAIT, VARIANT_CHANGING_PLANS_AND_INCREASING_IO, VARIANT_CHANGING_PLANS_AND_INCREASING_CPU, VARIANT_CHANGING_PLANS_AND_INCREASING_INEFFICIENT_WAIT, INEFFICIENT_CHANGING_PLANS, INEFFICIENT_INCREASING_INEFFICIENT_WAIT, INEFFICIENT_CHANGING_PLANS_AND_INCREASING_INEFFICIENT_WAIT

Returns:

  • (String)


54
55
56
# File 'lib/oci/opsi/models/sql_insight_aggregation.rb', line 54

def category
  @category
end

#textString

[Required] Insight text. For example Degrading SQLs, Variant SQLs, Inefficient SQLs, Improving SQLs, SQLs with Plan Changes, Degrading SQLs have increasing IO Time above 50%, Degrading SQLs are variant, 2 of the 2 variant SQLs have plan changes, `Inefficient SQLs have increasing CPU Time above 50%

Returns:

  • (String)


20
21
22
# File 'lib/oci/opsi/models/sql_insight_aggregation.rb', line 20

def text
  @text
end

#valuesArray<Integer>

[Required] SQL counts for a given insight. For example insight text 2 of 10 SQLs have degrading response time will have values as [2,10]"

Returns:

  • (Array<Integer>)


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

def values
  @values
end

Class Method Details

.attribute_mapObject

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



57
58
59
60
61
62
63
64
65
# File 'lib/oci/opsi/models/sql_insight_aggregation.rb', line 57

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'text': :'text',
    'values': :'values',
    'category': :'category'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



68
69
70
71
72
73
74
75
76
# File 'lib/oci/opsi/models/sql_insight_aggregation.rb', line 68

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'text': :'String',
    'values': :'Array<Integer>',
    'category': :'String'
    # 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



107
108
109
110
111
112
113
114
# File 'lib/oci/opsi/models/sql_insight_aggregation.rb', line 107

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

  self.class == other.class &&
    text == other.text &&
    values == other.values &&
    category == other.category
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



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/oci/opsi/models/sql_insight_aggregation.rb', line 139

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


119
120
121
# File 'lib/oci/opsi/models/sql_insight_aggregation.rb', line 119

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



128
129
130
# File 'lib/oci/opsi/models/sql_insight_aggregation.rb', line 128

def hash
  [text, values, category].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



172
173
174
175
176
177
178
179
180
181
# File 'lib/oci/opsi/models/sql_insight_aggregation.rb', line 172

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



166
167
168
# File 'lib/oci/opsi/models/sql_insight_aggregation.rb', line 166

def to_s
  to_hash.to_s
end