Class: OCI::DatabaseManagement::Models::MySqlQuerySampleDetails

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

Overview

The details of a query sample including the query text, execution time, and other details. MySQL support within OCI Database Management service has been deprecated as of January 29, 2026.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MySqlQuerySampleDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :query_sample_text (String)

    The value to assign to the #query_sample_text property

  • :time_query_sample_seen (DateTime)

    The value to assign to the #time_query_sample_seen property

  • :execution_time (Integer)

    The value to assign to the #execution_time property

  • :thread_id (Integer)

    The value to assign to the #thread_id property

  • :user (String)

    The value to assign to the #user property

  • :host (String)

    The value to assign to the #host property

  • :mysql_instance (String)

    The value to assign to the #mysql_instance property



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
116
117
118
119
120
121
# File 'lib/oci/database_management/models/my_sql_query_sample_details.rb', line 82

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

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

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

  self.time_query_sample_seen = attributes[:'timeQuerySampleSeen'] if attributes[:'timeQuerySampleSeen']

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

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

  self.execution_time = attributes[:'executionTime'] if attributes[:'executionTime']

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

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

  self.thread_id = attributes[:'threadId'] if attributes[:'threadId']

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

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

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

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

  self.mysql_instance = attributes[:'mysqlInstance'] if attributes[:'mysqlInstance']

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

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

Instance Attribute Details

#execution_timeInteger

[Required] The total amount of time that has been spent executing the query sample.

Returns:

  • (Integer)


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

def execution_time
  @execution_time
end

#hostString

[Required] The host from which the query sample was run.

Returns:

  • (String)


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

def host
  @host
end

#mysql_instanceString

[Required] The MySQL instance against which the query sample was run.

Returns:

  • (String)


37
38
39
# File 'lib/oci/database_management/models/my_sql_query_sample_details.rb', line 37

def mysql_instance
  @mysql_instance
end

#query_sample_textString

[Required] The query sample mapped by MySQL to a given normalized query.

Returns:

  • (String)


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

def query_sample_text
  @query_sample_text
end

#thread_idInteger

[Required] The thread ID of the connection.

Returns:

  • (Integer)


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

def thread_id
  @thread_id
end

#time_query_sample_seenDateTime

[Required] The date and time the query sample was last seen.

Returns:

  • (DateTime)


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

def time_query_sample_seen
  @time_query_sample_seen
end

#userString

[Required] The user who ran the query sample.

Returns:

  • (String)


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

def user
  @user
end

Class Method Details

.attribute_mapObject

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



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/oci/database_management/models/my_sql_query_sample_details.rb', line 40

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'query_sample_text': :'querySampleText',
    'time_query_sample_seen': :'timeQuerySampleSeen',
    'execution_time': :'executionTime',
    'thread_id': :'threadId',
    'user': :'user',
    'host': :'host',
    'mysql_instance': :'mysqlInstance'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/oci/database_management/models/my_sql_query_sample_details.rb', line 55

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'query_sample_text': :'String',
    'time_query_sample_seen': :'DateTime',
    'execution_time': :'Integer',
    'thread_id': :'Integer',
    'user': :'String',
    'host': :'String',
    'mysql_instance': :'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



130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/oci/database_management/models/my_sql_query_sample_details.rb', line 130

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

  self.class == other.class &&
    query_sample_text == other.query_sample_text &&
    time_query_sample_seen == other.time_query_sample_seen &&
    execution_time == other.execution_time &&
    thread_id == other.thread_id &&
    user == other.user &&
    host == other.host &&
    mysql_instance == other.mysql_instance
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



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/oci/database_management/models/my_sql_query_sample_details.rb', line 166

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


146
147
148
# File 'lib/oci/database_management/models/my_sql_query_sample_details.rb', line 146

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



155
156
157
# File 'lib/oci/database_management/models/my_sql_query_sample_details.rb', line 155

def hash
  [query_sample_text, time_query_sample_seen, execution_time, thread_id, user, host, mysql_instance].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



199
200
201
202
203
204
205
206
207
208
# File 'lib/oci/database_management/models/my_sql_query_sample_details.rb', line 199

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



193
194
195
# File 'lib/oci/database_management/models/my_sql_query_sample_details.rb', line 193

def to_s
  to_hash.to_s
end