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.
Constant Summary collapse
- SOURCE_NAME_ENUM =
[ SOURCE_NAME_TRACES = 'TRACES'.freeze, SOURCE_NAME_SYN_TRACES = 'SYN_TRACES'.freeze, SOURCE_NAME_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
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.
-
#source_name ⇒ String
Source of trace (traces, syn_traces).
-
#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
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 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/oci/apm_traces/models/trace.rb', line 202 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.source_name = attributes[:'sourceName'] if attributes[:'sourceName'] raise 'You cannot provide both :sourceName and :source_name' if attributes.key?(:'sourceName') && attributes.key?(:'source_name') self.source_name = attributes[:'source_name'] if attributes[:'source_name'] 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.
53 54 55 |
# File 'lib/oci/apm_traces/models/trace.rb', line 53 def error_span_count @error_span_count end |
#is_fault ⇒ BOOLEAN
Boolean flag that indicates whether the trace has an error.
83 84 85 |
# File 'lib/oci/apm_traces/models/trace.rb', line 83 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.
24 25 26 |
# File 'lib/oci/apm_traces/models/trace.rb', line 24 def key @key end |
#root_span_duration_in_ms ⇒ Integer
Time taken for the root span operation to complete in milliseconds.
73 74 75 |
# File 'lib/oci/apm_traces/models/trace.rb', line 73 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.
30 31 32 |
# File 'lib/oci/apm_traces/models/trace.rb', line 30 def root_span_operation_name @root_span_operation_name end |
#root_span_service_name ⇒ String
Service associated with the trace.
58 59 60 |
# File 'lib/oci/apm_traces/models/trace.rb', line 58 def root_span_service_name @root_span_service_name end |
#service_summaries ⇒ Array<OCI::ApmTraces::Models::TraceServiceSummary>
A summary of the spans by service.
108 109 110 |
# File 'lib/oci/apm_traces/models/trace.rb', line 108 def service_summaries @service_summaries end |
#source_name ⇒ String
Source of trace (traces, syn_traces).
113 114 115 |
# File 'lib/oci/apm_traces/models/trace.rb', line 113 def source_name @source_name 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.
47 48 49 |
# File 'lib/oci/apm_traces/models/trace.rb', line 47 def span_count @span_count end |
#span_summary ⇒ OCI::ApmTraces::Models::TraceSpanSummary
116 117 118 |
# File 'lib/oci/apm_traces/models/trace.rb', line 116 def span_summary @span_summary end |
#spans ⇒ Array<OCI::ApmTraces::Models::Span>
[Required] An array of spans in the trace.
121 122 123 |
# File 'lib/oci/apm_traces/models/trace.rb', line 121 def spans @spans end |
#time_earliest_span_started ⇒ DateTime
Start time of the earliest span in the span collection.
35 36 37 |
# File 'lib/oci/apm_traces/models/trace.rb', line 35 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.
40 41 42 |
# File 'lib/oci/apm_traces/models/trace.rb', line 40 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.
68 69 70 |
# File 'lib/oci/apm_traces/models/trace.rb', line 68 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.
63 64 65 |
# File 'lib/oci/apm_traces/models/trace.rb', line 63 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.
78 79 80 |
# File 'lib/oci/apm_traces/models/trace.rb', line 78 def trace_duration_in_ms @trace_duration_in_ms end |
#trace_error_code ⇒ String
Error code of the trace.
103 104 105 |
# File 'lib/oci/apm_traces/models/trace.rb', line 103 def trace_error_code @trace_error_code end |
#trace_error_type ⇒ String
Error type of the trace.
98 99 100 |
# File 'lib/oci/apm_traces/models/trace.rb', line 98 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.
93 94 95 |
# File 'lib/oci/apm_traces/models/trace.rb', line 93 def trace_status @trace_status end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/oci/apm_traces/models/trace.rb', line 124 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', 'source_name': :'sourceName', 'span_summary': :'spanSummary', 'spans': :'spans' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/oci/apm_traces/models/trace.rb', line 151 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>', 'source_name': :'String', '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.
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'lib/oci/apm_traces/models/trace.rb', line 335 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 && source_name == other.source_name && span_summary == other.span_summary && spans == other.spans end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 |
# File 'lib/oci/apm_traces/models/trace.rb', line 383 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
363 364 365 |
# File 'lib/oci/apm_traces/models/trace.rb', line 363 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
372 373 374 |
# File 'lib/oci/apm_traces/models/trace.rb', line 372 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, source_name, span_summary, spans].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
416 417 418 419 420 421 422 423 424 425 |
# File 'lib/oci/apm_traces/models/trace.rb', line 416 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
410 411 412 |
# File 'lib/oci/apm_traces/models/trace.rb', line 410 def to_s to_hash.to_s end |