Class: OCI::ApmTraces::Models::Trace
- Inherits:
-
Object
- Object
- OCI::ApmTraces::Models::Trace
- Defined in:
- lib/oci/apm_traces/models/trace.rb
Overview
Definition of a trace object.
Instance Attribute Summary collapse
-
#error_span_count ⇒ Integer
The number of spans with errors that have been processed by the system for the trace.
-
#is_fault ⇒ BOOLEAN
Boolean flag that indicates whether the trace has an error.
-
#key ⇒ String
[Required] Unique identifier (traceId) for the trace that represents the span set.
-
#root_span_duration_in_ms ⇒ Integer
Time taken for the root span operation to complete in milliseconds.
-
#root_span_operation_name ⇒ String
Root span name associated with the trace.
-
#root_span_service_name ⇒ String
Service associated with the trace.
-
#service_summaries ⇒ Array<OCI::ApmTraces::Models::TraceServiceSummary>
A summary of the spans by service.
-
#span_count ⇒ Integer
The number of spans that have been processed by the system for the trace.
- #span_summary ⇒ OCI::ApmTraces::Models::TraceSpanSummary
-
#spans ⇒ Array<OCI::ApmTraces::Models::Span>
[Required] An array of spans in the trace.
-
#time_earliest_span_started ⇒ DateTime
Start time of the earliest span in the span collection.
-
#time_latest_span_ended ⇒ DateTime
End time of the span that most recently ended in the span collection.
-
#time_root_span_ended ⇒ DateTime
End time of the root span for the span collection.
-
#time_root_span_started ⇒ DateTime
Start time of the root span for the span collection.
-
#trace_duration_in_ms ⇒ Integer
Time between the start of the earliest span and the end of the most recent span in milliseconds.
-
#trace_error_code ⇒ String
Error code of the trace.
-
#trace_error_type ⇒ String
Error type of the trace.
-
#trace_status ⇒ String
The status of the trace.
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 = {}) ⇒ Trace
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 = {}) ⇒ Trace
Initializes the object
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 281 282 283 284 285 286 287 288 289 290 291 292 |
# File 'lib/oci/apm_traces/models/trace.rb', line 187 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.key = attributes[:'key'] if attributes[:'key'] self.root_span_operation_name = attributes[:'rootSpanOperationName'] if attributes[:'rootSpanOperationName'] raise 'You cannot provide both :rootSpanOperationName and :root_span_operation_name' if attributes.key?(:'rootSpanOperationName') && attributes.key?(:'root_span_operation_name') self.root_span_operation_name = attributes[:'root_span_operation_name'] if attributes[:'root_span_operation_name'] self.time_earliest_span_started = attributes[:'timeEarliestSpanStarted'] if attributes[:'timeEarliestSpanStarted'] raise 'You cannot provide both :timeEarliestSpanStarted and :time_earliest_span_started' if attributes.key?(:'timeEarliestSpanStarted') && attributes.key?(:'time_earliest_span_started') self.time_earliest_span_started = attributes[:'time_earliest_span_started'] if attributes[:'time_earliest_span_started'] self.time_latest_span_ended = attributes[:'timeLatestSpanEnded'] if attributes[:'timeLatestSpanEnded'] raise 'You cannot provide both :timeLatestSpanEnded and :time_latest_span_ended' if attributes.key?(:'timeLatestSpanEnded') && attributes.key?(:'time_latest_span_ended') self.time_latest_span_ended = attributes[:'time_latest_span_ended'] if attributes[:'time_latest_span_ended'] self.span_count = attributes[:'spanCount'] if attributes[:'spanCount'] raise 'You cannot provide both :spanCount and :span_count' if attributes.key?(:'spanCount') && attributes.key?(:'span_count') self.span_count = attributes[:'span_count'] if attributes[:'span_count'] self.error_span_count = attributes[:'errorSpanCount'] if attributes[:'errorSpanCount'] raise 'You cannot provide both :errorSpanCount and :error_span_count' if attributes.key?(:'errorSpanCount') && attributes.key?(:'error_span_count') self.error_span_count = attributes[:'error_span_count'] if attributes[:'error_span_count'] self.root_span_service_name = attributes[:'rootSpanServiceName'] if attributes[:'rootSpanServiceName'] raise 'You cannot provide both :rootSpanServiceName and :root_span_service_name' if attributes.key?(:'rootSpanServiceName') && attributes.key?(:'root_span_service_name') self.root_span_service_name = attributes[:'root_span_service_name'] if attributes[:'root_span_service_name'] self.time_root_span_started = attributes[:'timeRootSpanStarted'] if attributes[:'timeRootSpanStarted'] raise 'You cannot provide both :timeRootSpanStarted and :time_root_span_started' if attributes.key?(:'timeRootSpanStarted') && attributes.key?(:'time_root_span_started') self.time_root_span_started = attributes[:'time_root_span_started'] if attributes[:'time_root_span_started'] self.time_root_span_ended = attributes[:'timeRootSpanEnded'] if attributes[:'timeRootSpanEnded'] raise 'You cannot provide both :timeRootSpanEnded and :time_root_span_ended' if attributes.key?(:'timeRootSpanEnded') && attributes.key?(:'time_root_span_ended') self.time_root_span_ended = attributes[:'time_root_span_ended'] if attributes[:'time_root_span_ended'] self.root_span_duration_in_ms = attributes[:'rootSpanDurationInMs'] if attributes[:'rootSpanDurationInMs'] raise 'You cannot provide both :rootSpanDurationInMs and :root_span_duration_in_ms' if attributes.key?(:'rootSpanDurationInMs') && attributes.key?(:'root_span_duration_in_ms') self.root_span_duration_in_ms = attributes[:'root_span_duration_in_ms'] if attributes[:'root_span_duration_in_ms'] self.trace_duration_in_ms = attributes[:'traceDurationInMs'] if attributes[:'traceDurationInMs'] raise 'You cannot provide both :traceDurationInMs and :trace_duration_in_ms' if attributes.key?(:'traceDurationInMs') && attributes.key?(:'trace_duration_in_ms') self.trace_duration_in_ms = attributes[:'trace_duration_in_ms'] if attributes[:'trace_duration_in_ms'] self.is_fault = attributes[:'isFault'] unless attributes[:'isFault'].nil? raise 'You cannot provide both :isFault and :is_fault' if attributes.key?(:'isFault') && attributes.key?(:'is_fault') self.is_fault = attributes[:'is_fault'] unless attributes[:'is_fault'].nil? self.trace_status = attributes[:'traceStatus'] if attributes[:'traceStatus'] raise 'You cannot provide both :traceStatus and :trace_status' if attributes.key?(:'traceStatus') && attributes.key?(:'trace_status') self.trace_status = attributes[:'trace_status'] if attributes[:'trace_status'] self.trace_error_type = attributes[:'traceErrorType'] if attributes[:'traceErrorType'] raise 'You cannot provide both :traceErrorType and :trace_error_type' if attributes.key?(:'traceErrorType') && attributes.key?(:'trace_error_type') self.trace_error_type = attributes[:'trace_error_type'] if attributes[:'trace_error_type'] self.trace_error_code = attributes[:'traceErrorCode'] if attributes[:'traceErrorCode'] raise 'You cannot provide both :traceErrorCode and :trace_error_code' if attributes.key?(:'traceErrorCode') && attributes.key?(:'trace_error_code') self.trace_error_code = attributes[:'trace_error_code'] if attributes[:'trace_error_code'] self.service_summaries = attributes[:'serviceSummaries'] if attributes[:'serviceSummaries'] raise 'You cannot provide both :serviceSummaries and :service_summaries' if attributes.key?(:'serviceSummaries') && attributes.key?(:'service_summaries') self.service_summaries = attributes[:'service_summaries'] if attributes[:'service_summaries'] self.span_summary = attributes[:'spanSummary'] if attributes[:'spanSummary'] raise 'You cannot provide both :spanSummary and :span_summary' if attributes.key?(:'spanSummary') && attributes.key?(:'span_summary') self.span_summary = attributes[:'span_summary'] if attributes[:'span_summary'] self.spans = attributes[:'spans'] if attributes[:'spans'] end |
Instance Attribute Details
#error_span_count ⇒ Integer
The number of spans with errors that have been processed by the system for the trace. Note that the number of spans with errors will be less than or equal to the total number of spans in the trace.
46 47 48 |
# File 'lib/oci/apm_traces/models/trace.rb', line 46 def error_span_count @error_span_count end |
#is_fault ⇒ BOOLEAN
Boolean flag that indicates whether the trace has an error.
76 77 78 |
# File 'lib/oci/apm_traces/models/trace.rb', line 76 def is_fault @is_fault end |
#key ⇒ String
[Required] Unique identifier (traceId) for the trace that represents the span set. Note that this field is defined as traceKey in the API and it maps to the traceId in the trace data in Application Performance Monitoring.
17 18 19 |
# File 'lib/oci/apm_traces/models/trace.rb', line 17 def key @key end |
#root_span_duration_in_ms ⇒ Integer
Time taken for the root span operation to complete in milliseconds.
66 67 68 |
# File 'lib/oci/apm_traces/models/trace.rb', line 66 def root_span_duration_in_ms @root_span_duration_in_ms end |
#root_span_operation_name ⇒ String
Root span name associated with the trace. This is the flow start operation name. Null is displayed if the root span is not yet completed.
23 24 25 |
# File 'lib/oci/apm_traces/models/trace.rb', line 23 def root_span_operation_name @root_span_operation_name end |
#root_span_service_name ⇒ String
Service associated with the trace.
51 52 53 |
# File 'lib/oci/apm_traces/models/trace.rb', line 51 def root_span_service_name @root_span_service_name end |
#service_summaries ⇒ Array<OCI::ApmTraces::Models::TraceServiceSummary>
A summary of the spans by service.
101 102 103 |
# File 'lib/oci/apm_traces/models/trace.rb', line 101 def service_summaries @service_summaries end |
#span_count ⇒ Integer
The number of spans that have been processed by the system for the trace. Note that there could be additional spans that have not been processed or reported yet if the trace is still in progress.
40 41 42 |
# File 'lib/oci/apm_traces/models/trace.rb', line 40 def span_count @span_count end |
#span_summary ⇒ OCI::ApmTraces::Models::TraceSpanSummary
104 105 106 |
# File 'lib/oci/apm_traces/models/trace.rb', line 104 def span_summary @span_summary end |
#spans ⇒ Array<OCI::ApmTraces::Models::Span>
[Required] An array of spans in the trace.
109 110 111 |
# File 'lib/oci/apm_traces/models/trace.rb', line 109 def spans @spans end |
#time_earliest_span_started ⇒ DateTime
Start time of the earliest span in the span collection.
28 29 30 |
# File 'lib/oci/apm_traces/models/trace.rb', line 28 def time_earliest_span_started @time_earliest_span_started end |
#time_latest_span_ended ⇒ DateTime
End time of the span that most recently ended in the span collection.
33 34 35 |
# File 'lib/oci/apm_traces/models/trace.rb', line 33 def time_latest_span_ended @time_latest_span_ended end |
#time_root_span_ended ⇒ DateTime
End time of the root span for the span collection.
61 62 63 |
# File 'lib/oci/apm_traces/models/trace.rb', line 61 def time_root_span_ended @time_root_span_ended end |
#time_root_span_started ⇒ DateTime
Start time of the root span for the span collection.
56 57 58 |
# File 'lib/oci/apm_traces/models/trace.rb', line 56 def time_root_span_started @time_root_span_started end |
#trace_duration_in_ms ⇒ Integer
Time between the start of the earliest span and the end of the most recent span in milliseconds.
71 72 73 |
# File 'lib/oci/apm_traces/models/trace.rb', line 71 def trace_duration_in_ms @trace_duration_in_ms end |
#trace_error_code ⇒ String
Error code of the trace.
96 97 98 |
# File 'lib/oci/apm_traces/models/trace.rb', line 96 def trace_error_code @trace_error_code end |
#trace_error_type ⇒ String
Error type of the trace.
91 92 93 |
# File 'lib/oci/apm_traces/models/trace.rb', line 91 def trace_error_type @trace_error_type end |
#trace_status ⇒ String
The status of the trace. The trace statuses are defined as follows: complete - a root span has been recorded, but there is no information on the errors. success - a complete root span is recorded there is a successful error type and error code - HTTP 200. incomplete - the root span has not yet been received. error - the root span returned with an error. There may or may not be an associated error code or error type.
86 87 88 |
# File 'lib/oci/apm_traces/models/trace.rb', line 86 def trace_status @trace_status end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/oci/apm_traces/models/trace.rb', line 112 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'key': :'key', 'root_span_operation_name': :'rootSpanOperationName', 'time_earliest_span_started': :'timeEarliestSpanStarted', 'time_latest_span_ended': :'timeLatestSpanEnded', 'span_count': :'spanCount', 'error_span_count': :'errorSpanCount', 'root_span_service_name': :'rootSpanServiceName', 'time_root_span_started': :'timeRootSpanStarted', 'time_root_span_ended': :'timeRootSpanEnded', 'root_span_duration_in_ms': :'rootSpanDurationInMs', 'trace_duration_in_ms': :'traceDurationInMs', 'is_fault': :'isFault', 'trace_status': :'traceStatus', 'trace_error_type': :'traceErrorType', 'trace_error_code': :'traceErrorCode', 'service_summaries': :'serviceSummaries', 'span_summary': :'spanSummary', 'spans': :'spans' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
138 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/apm_traces/models/trace.rb', line 138 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'key': :'String', 'root_span_operation_name': :'String', 'time_earliest_span_started': :'DateTime', 'time_latest_span_ended': :'DateTime', 'span_count': :'Integer', 'error_span_count': :'Integer', 'root_span_service_name': :'String', 'time_root_span_started': :'DateTime', 'time_root_span_ended': :'DateTime', 'root_span_duration_in_ms': :'Integer', 'trace_duration_in_ms': :'Integer', 'is_fault': :'BOOLEAN', 'trace_status': :'String', 'trace_error_type': :'String', 'trace_error_code': :'String', 'service_summaries': :'Array<OCI::ApmTraces::Models::TraceServiceSummary>', 'span_summary': :'OCI::ApmTraces::Models::TraceSpanSummary', 'spans': :'Array<OCI::ApmTraces::Models::Span>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
# File 'lib/oci/apm_traces/models/trace.rb', line 301 def ==(other) return true if equal?(other) self.class == other.class && key == other.key && root_span_operation_name == other.root_span_operation_name && time_earliest_span_started == other.time_earliest_span_started && time_latest_span_ended == other.time_latest_span_ended && span_count == other.span_count && error_span_count == other.error_span_count && root_span_service_name == other.root_span_service_name && time_root_span_started == other.time_root_span_started && time_root_span_ended == other.time_root_span_ended && root_span_duration_in_ms == other.root_span_duration_in_ms && trace_duration_in_ms == other.trace_duration_in_ms && is_fault == other.is_fault && trace_status == other.trace_status && trace_error_type == other.trace_error_type && trace_error_code == other.trace_error_code && service_summaries == other.service_summaries && span_summary == other.span_summary && spans == other.spans end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
# File 'lib/oci/apm_traces/models/trace.rb', line 348 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
328 329 330 |
# File 'lib/oci/apm_traces/models/trace.rb', line 328 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
337 338 339 |
# File 'lib/oci/apm_traces/models/trace.rb', line 337 def hash [key, root_span_operation_name, time_earliest_span_started, time_latest_span_ended, span_count, error_span_count, root_span_service_name, time_root_span_started, time_root_span_ended, root_span_duration_in_ms, trace_duration_in_ms, is_fault, trace_status, trace_error_type, trace_error_code, service_summaries, span_summary, spans].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
381 382 383 384 385 386 387 388 389 390 |
# File 'lib/oci/apm_traces/models/trace.rb', line 381 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
375 376 377 |
# File 'lib/oci/apm_traces/models/trace.rb', line 375 def to_s to_hash.to_s end |