Class: OCI::Opsi::Models::SqlStatistics
- Inherits:
-
Object
- Object
- OCI::Opsi::Models::SqlStatistics
- Defined in:
- lib/oci/opsi/models/sql_statistics.rb
Overview
Performance statistics for the SQL.
Instance Attribute Summary collapse
-
#average_active_sessions ⇒ Float
[Required] Average Active Sessions represent the average active sessions at a point in time.
-
#change_in_average_active_sessions_in_pct ⇒ Float
[Required] Percent change in Average Active Sessions based on linear regression.
-
#change_in_cpu_time_in_pct ⇒ Float
[Required] Percent change in CPU Time based on linear regression.
-
#change_in_executions_per_hour_in_pct ⇒ Float
[Required] Percent change in Executions per hour based on linear regression.
-
#change_in_inefficiency_in_pct ⇒ Float
[Required] Percent change in Inefficiency based on linear regression.
-
#change_in_inefficient_wait_time_in_pct ⇒ Float
[Required] Percent change in Inefficient Wait Time based on linear regression.
-
#change_in_io_time_in_pct ⇒ Float
[Required] Percent change in IO Time based on linear regression.
-
#change_in_response_time_in_pct ⇒ Float
[Required] Percent change in Response Time based on linear regression.
-
#cpu_time_in_sec ⇒ Float
[Required] CPU Time in seconds.
-
#database_time_in_sec ⇒ Float
[Required] Database Time in seconds.
-
#database_time_pct ⇒ Float
[Required] Percentage of Database Time.
-
#executions_count ⇒ Integer
[Required] Total number of executions.
-
#executions_per_hour ⇒ Float
[Required] Number of executions per hour.
-
#inefficiency_in_pct ⇒ Float
[Required] Percentage of Inefficiency.
-
#inefficient_wait_time_in_sec ⇒ Float
[Required] Inefficient Wait Time in seconds.
-
#io_time_in_sec ⇒ Float
[Required] I/O Time in seconds.
-
#plan_count ⇒ Integer
[Required] Number of SQL execution plans used by the SQL.
-
#response_time_in_sec ⇒ Float
[Required] Response time is the average elaspsed time per execution.
-
#variability ⇒ Float
[Required] Variability is the ratio of the standard deviation in response time to the mean of response time of the SQL.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ SqlStatistics
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ SqlStatistics
Initializes the object
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 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 165 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.database_time_in_sec = attributes[:'databaseTimeInSec'] if attributes[:'databaseTimeInSec'] raise 'You cannot provide both :databaseTimeInSec and :database_time_in_sec' if attributes.key?(:'databaseTimeInSec') && attributes.key?(:'database_time_in_sec') self.database_time_in_sec = attributes[:'database_time_in_sec'] if attributes[:'database_time_in_sec'] self.executions_per_hour = attributes[:'executionsPerHour'] if attributes[:'executionsPerHour'] raise 'You cannot provide both :executionsPerHour and :executions_per_hour' if attributes.key?(:'executionsPerHour') && attributes.key?(:'executions_per_hour') self.executions_per_hour = attributes[:'executions_per_hour'] if attributes[:'executions_per_hour'] self.executions_count = attributes[:'executionsCount'] if attributes[:'executionsCount'] raise 'You cannot provide both :executionsCount and :executions_count' if attributes.key?(:'executionsCount') && attributes.key?(:'executions_count') self.executions_count = attributes[:'executions_count'] if attributes[:'executions_count'] self.cpu_time_in_sec = attributes[:'cpuTimeInSec'] if attributes[:'cpuTimeInSec'] raise 'You cannot provide both :cpuTimeInSec and :cpu_time_in_sec' if attributes.key?(:'cpuTimeInSec') && attributes.key?(:'cpu_time_in_sec') self.cpu_time_in_sec = attributes[:'cpu_time_in_sec'] if attributes[:'cpu_time_in_sec'] self.io_time_in_sec = attributes[:'ioTimeInSec'] if attributes[:'ioTimeInSec'] raise 'You cannot provide both :ioTimeInSec and :io_time_in_sec' if attributes.key?(:'ioTimeInSec') && attributes.key?(:'io_time_in_sec') self.io_time_in_sec = attributes[:'io_time_in_sec'] if attributes[:'io_time_in_sec'] self.inefficient_wait_time_in_sec = attributes[:'inefficientWaitTimeInSec'] if attributes[:'inefficientWaitTimeInSec'] raise 'You cannot provide both :inefficientWaitTimeInSec and :inefficient_wait_time_in_sec' if attributes.key?(:'inefficientWaitTimeInSec') && attributes.key?(:'inefficient_wait_time_in_sec') self.inefficient_wait_time_in_sec = attributes[:'inefficient_wait_time_in_sec'] if attributes[:'inefficient_wait_time_in_sec'] self.response_time_in_sec = attributes[:'responseTimeInSec'] if attributes[:'responseTimeInSec'] raise 'You cannot provide both :responseTimeInSec and :response_time_in_sec' if attributes.key?(:'responseTimeInSec') && attributes.key?(:'response_time_in_sec') self.response_time_in_sec = attributes[:'response_time_in_sec'] if attributes[:'response_time_in_sec'] self.plan_count = attributes[:'planCount'] if attributes[:'planCount'] raise 'You cannot provide both :planCount and :plan_count' if attributes.key?(:'planCount') && attributes.key?(:'plan_count') self.plan_count = attributes[:'plan_count'] if attributes[:'plan_count'] self.variability = attributes[:'variability'] if attributes[:'variability'] self.average_active_sessions = attributes[:'averageActiveSessions'] if attributes[:'averageActiveSessions'] raise 'You cannot provide both :averageActiveSessions and :average_active_sessions' if attributes.key?(:'averageActiveSessions') && attributes.key?(:'average_active_sessions') self.average_active_sessions = attributes[:'average_active_sessions'] if attributes[:'average_active_sessions'] self.database_time_pct = attributes[:'databaseTimePct'] if attributes[:'databaseTimePct'] raise 'You cannot provide both :databaseTimePct and :database_time_pct' if attributes.key?(:'databaseTimePct') && attributes.key?(:'database_time_pct') self.database_time_pct = attributes[:'database_time_pct'] if attributes[:'database_time_pct'] self.inefficiency_in_pct = attributes[:'inefficiencyInPct'] if attributes[:'inefficiencyInPct'] raise 'You cannot provide both :inefficiencyInPct and :inefficiency_in_pct' if attributes.key?(:'inefficiencyInPct') && attributes.key?(:'inefficiency_in_pct') self.inefficiency_in_pct = attributes[:'inefficiency_in_pct'] if attributes[:'inefficiency_in_pct'] self.change_in_cpu_time_in_pct = attributes[:'changeInCpuTimeInPct'] if attributes[:'changeInCpuTimeInPct'] raise 'You cannot provide both :changeInCpuTimeInPct and :change_in_cpu_time_in_pct' if attributes.key?(:'changeInCpuTimeInPct') && attributes.key?(:'change_in_cpu_time_in_pct') self.change_in_cpu_time_in_pct = attributes[:'change_in_cpu_time_in_pct'] if attributes[:'change_in_cpu_time_in_pct'] self.change_in_io_time_in_pct = attributes[:'changeInIoTimeInPct'] if attributes[:'changeInIoTimeInPct'] raise 'You cannot provide both :changeInIoTimeInPct and :change_in_io_time_in_pct' if attributes.key?(:'changeInIoTimeInPct') && attributes.key?(:'change_in_io_time_in_pct') self.change_in_io_time_in_pct = attributes[:'change_in_io_time_in_pct'] if attributes[:'change_in_io_time_in_pct'] self.change_in_inefficient_wait_time_in_pct = attributes[:'changeInInefficientWaitTimeInPct'] if attributes[:'changeInInefficientWaitTimeInPct'] raise 'You cannot provide both :changeInInefficientWaitTimeInPct and :change_in_inefficient_wait_time_in_pct' if attributes.key?(:'changeInInefficientWaitTimeInPct') && attributes.key?(:'change_in_inefficient_wait_time_in_pct') self.change_in_inefficient_wait_time_in_pct = attributes[:'change_in_inefficient_wait_time_in_pct'] if attributes[:'change_in_inefficient_wait_time_in_pct'] self.change_in_response_time_in_pct = attributes[:'changeInResponseTimeInPct'] if attributes[:'changeInResponseTimeInPct'] raise 'You cannot provide both :changeInResponseTimeInPct and :change_in_response_time_in_pct' if attributes.key?(:'changeInResponseTimeInPct') && attributes.key?(:'change_in_response_time_in_pct') self.change_in_response_time_in_pct = attributes[:'change_in_response_time_in_pct'] if attributes[:'change_in_response_time_in_pct'] self.change_in_average_active_sessions_in_pct = attributes[:'changeInAverageActiveSessionsInPct'] if attributes[:'changeInAverageActiveSessionsInPct'] raise 'You cannot provide both :changeInAverageActiveSessionsInPct and :change_in_average_active_sessions_in_pct' if attributes.key?(:'changeInAverageActiveSessionsInPct') && attributes.key?(:'change_in_average_active_sessions_in_pct') self.change_in_average_active_sessions_in_pct = attributes[:'change_in_average_active_sessions_in_pct'] if attributes[:'change_in_average_active_sessions_in_pct'] self.change_in_executions_per_hour_in_pct = attributes[:'changeInExecutionsPerHourInPct'] if attributes[:'changeInExecutionsPerHourInPct'] raise 'You cannot provide both :changeInExecutionsPerHourInPct and :change_in_executions_per_hour_in_pct' if attributes.key?(:'changeInExecutionsPerHourInPct') && attributes.key?(:'change_in_executions_per_hour_in_pct') self.change_in_executions_per_hour_in_pct = attributes[:'change_in_executions_per_hour_in_pct'] if attributes[:'change_in_executions_per_hour_in_pct'] self.change_in_inefficiency_in_pct = attributes[:'changeInInefficiencyInPct'] if attributes[:'changeInInefficiencyInPct'] raise 'You cannot provide both :changeInInefficiencyInPct and :change_in_inefficiency_in_pct' if attributes.key?(:'changeInInefficiencyInPct') && attributes.key?(:'change_in_inefficiency_in_pct') self.change_in_inefficiency_in_pct = attributes[:'change_in_inefficiency_in_pct'] if attributes[:'change_in_inefficiency_in_pct'] end |
Instance Attribute Details
#average_active_sessions ⇒ Float
[Required] Average Active Sessions represent the average active sessions at a point in time. It is the number of sessions that are either working or waiting.
48 49 50 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 48 def average_active_sessions @average_active_sessions end |
#change_in_average_active_sessions_in_pct ⇒ Float
[Required] Percent change in Average Active Sessions based on linear regression
76 77 78 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 76 def change_in_average_active_sessions_in_pct @change_in_average_active_sessions_in_pct end |
#change_in_cpu_time_in_pct ⇒ Float
[Required] Percent change in CPU Time based on linear regression
60 61 62 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 60 def change_in_cpu_time_in_pct @change_in_cpu_time_in_pct end |
#change_in_executions_per_hour_in_pct ⇒ Float
[Required] Percent change in Executions per hour based on linear regression
80 81 82 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 80 def change_in_executions_per_hour_in_pct @change_in_executions_per_hour_in_pct end |
#change_in_inefficiency_in_pct ⇒ Float
[Required] Percent change in Inefficiency based on linear regression
84 85 86 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 84 def change_in_inefficiency_in_pct @change_in_inefficiency_in_pct end |
#change_in_inefficient_wait_time_in_pct ⇒ Float
[Required] Percent change in Inefficient Wait Time based on linear regression
68 69 70 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 68 def change_in_inefficient_wait_time_in_pct @change_in_inefficient_wait_time_in_pct end |
#change_in_io_time_in_pct ⇒ Float
[Required] Percent change in IO Time based on linear regression
64 65 66 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 64 def change_in_io_time_in_pct @change_in_io_time_in_pct end |
#change_in_response_time_in_pct ⇒ Float
[Required] Percent change in Response Time based on linear regression
72 73 74 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 72 def change_in_response_time_in_pct @change_in_response_time_in_pct end |
#cpu_time_in_sec ⇒ Float
[Required] CPU Time in seconds
24 25 26 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 24 def cpu_time_in_sec @cpu_time_in_sec end |
#database_time_in_sec ⇒ Float
[Required] Database Time in seconds
12 13 14 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 12 def database_time_in_sec @database_time_in_sec end |
#database_time_pct ⇒ Float
[Required] Percentage of Database Time
52 53 54 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 52 def database_time_pct @database_time_pct end |
#executions_count ⇒ Integer
[Required] Total number of executions
20 21 22 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 20 def executions_count @executions_count end |
#executions_per_hour ⇒ Float
[Required] Number of executions per hour
16 17 18 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 16 def executions_per_hour @executions_per_hour end |
#inefficiency_in_pct ⇒ Float
[Required] Percentage of Inefficiency. It is calculated by Total Database Time divided by Total Wait Time
56 57 58 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 56 def inefficiency_in_pct @inefficiency_in_pct end |
#inefficient_wait_time_in_sec ⇒ Float
[Required] Inefficient Wait Time in seconds
32 33 34 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 32 def inefficient_wait_time_in_sec @inefficient_wait_time_in_sec end |
#io_time_in_sec ⇒ Float
[Required] I/O Time in seconds
28 29 30 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 28 def io_time_in_sec @io_time_in_sec end |
#plan_count ⇒ Integer
[Required] Number of SQL execution plans used by the SQL
40 41 42 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 40 def plan_count @plan_count end |
#response_time_in_sec ⇒ Float
[Required] Response time is the average elaspsed time per execution. It is the ratio of Total Database Time to the number of executions
36 37 38 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 36 def response_time_in_sec @response_time_in_sec end |
#variability ⇒ Float
[Required] Variability is the ratio of the standard deviation in response time to the mean of response time of the SQL
44 45 46 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 44 def variability @variability end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 87 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'database_time_in_sec': :'databaseTimeInSec', 'executions_per_hour': :'executionsPerHour', 'executions_count': :'executionsCount', 'cpu_time_in_sec': :'cpuTimeInSec', 'io_time_in_sec': :'ioTimeInSec', 'inefficient_wait_time_in_sec': :'inefficientWaitTimeInSec', 'response_time_in_sec': :'responseTimeInSec', 'plan_count': :'planCount', 'variability': :'variability', 'average_active_sessions': :'averageActiveSessions', 'database_time_pct': :'databaseTimePct', 'inefficiency_in_pct': :'inefficiencyInPct', 'change_in_cpu_time_in_pct': :'changeInCpuTimeInPct', 'change_in_io_time_in_pct': :'changeInIoTimeInPct', 'change_in_inefficient_wait_time_in_pct': :'changeInInefficientWaitTimeInPct', 'change_in_response_time_in_pct': :'changeInResponseTimeInPct', 'change_in_average_active_sessions_in_pct': :'changeInAverageActiveSessionsInPct', 'change_in_executions_per_hour_in_pct': :'changeInExecutionsPerHourInPct', 'change_in_inefficiency_in_pct': :'changeInInefficiencyInPct' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 114 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'database_time_in_sec': :'Float', 'executions_per_hour': :'Float', 'executions_count': :'Integer', 'cpu_time_in_sec': :'Float', 'io_time_in_sec': :'Float', 'inefficient_wait_time_in_sec': :'Float', 'response_time_in_sec': :'Float', 'plan_count': :'Integer', 'variability': :'Float', 'average_active_sessions': :'Float', 'database_time_pct': :'Float', 'inefficiency_in_pct': :'Float', 'change_in_cpu_time_in_pct': :'Float', 'change_in_io_time_in_pct': :'Float', 'change_in_inefficient_wait_time_in_pct': :'Float', 'change_in_response_time_in_pct': :'Float', 'change_in_average_active_sessions_in_pct': :'Float', 'change_in_executions_per_hour_in_pct': :'Float', 'change_in_inefficiency_in_pct': :'Float' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 289 def ==(other) return true if equal?(other) self.class == other.class && database_time_in_sec == other.database_time_in_sec && executions_per_hour == other.executions_per_hour && executions_count == other.executions_count && cpu_time_in_sec == other.cpu_time_in_sec && io_time_in_sec == other.io_time_in_sec && inefficient_wait_time_in_sec == other.inefficient_wait_time_in_sec && response_time_in_sec == other.response_time_in_sec && plan_count == other.plan_count && variability == other.variability && average_active_sessions == other.average_active_sessions && database_time_pct == other.database_time_pct && inefficiency_in_pct == other.inefficiency_in_pct && change_in_cpu_time_in_pct == other.change_in_cpu_time_in_pct && change_in_io_time_in_pct == other.change_in_io_time_in_pct && change_in_inefficient_wait_time_in_pct == other.change_in_inefficient_wait_time_in_pct && change_in_response_time_in_pct == other.change_in_response_time_in_pct && change_in_average_active_sessions_in_pct == other.change_in_average_active_sessions_in_pct && change_in_executions_per_hour_in_pct == other.change_in_executions_per_hour_in_pct && change_in_inefficiency_in_pct == other.change_in_inefficiency_in_pct end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 337 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
317 318 319 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 317 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
326 327 328 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 326 def hash [database_time_in_sec, executions_per_hour, executions_count, cpu_time_in_sec, io_time_in_sec, inefficient_wait_time_in_sec, response_time_in_sec, plan_count, variability, average_active_sessions, database_time_pct, inefficiency_in_pct, change_in_cpu_time_in_pct, change_in_io_time_in_pct, change_in_inefficient_wait_time_in_pct, change_in_response_time_in_pct, change_in_average_active_sessions_in_pct, change_in_executions_per_hour_in_pct, change_in_inefficiency_in_pct].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
370 371 372 373 374 375 376 377 378 379 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 370 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_s ⇒ String
Returns the string representation of the object
364 365 366 |
# File 'lib/oci/opsi/models/sql_statistics.rb', line 364 def to_s to_hash.to_s end |