Class: OCI::ApmTraces::Models::Trace

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/apm_traces/models/trace.rb

Overview

Definition of a trace object.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Trace

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/oci/apm_traces/models/trace.rb', line 186

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_countInteger

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.

Returns:

  • (Integer)


45
46
47
# File 'lib/oci/apm_traces/models/trace.rb', line 45

def error_span_count
  @error_span_count
end

#is_faultBOOLEAN

Boolean flag that indicates whether the trace has an error.

Returns:

  • (BOOLEAN)


75
76
77
# File 'lib/oci/apm_traces/models/trace.rb', line 75

def is_fault
  @is_fault
end

#keyString

**[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.

Returns:

  • (String)


16
17
18
# File 'lib/oci/apm_traces/models/trace.rb', line 16

def key
  @key
end

#root_span_duration_in_msInteger

Time taken for the root span operation to complete in milliseconds.

Returns:

  • (Integer)


65
66
67
# File 'lib/oci/apm_traces/models/trace.rb', line 65

def root_span_duration_in_ms
  @root_span_duration_in_ms
end

#root_span_operation_nameString

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.

Returns:

  • (String)


22
23
24
# File 'lib/oci/apm_traces/models/trace.rb', line 22

def root_span_operation_name
  @root_span_operation_name
end

#root_span_service_nameString

Service associated with the trace.

Returns:

  • (String)


50
51
52
# File 'lib/oci/apm_traces/models/trace.rb', line 50

def root_span_service_name
  @root_span_service_name
end

#service_summariesArray<OCI::ApmTraces::Models::TraceServiceSummary>

A summary of the spans by service.



100
101
102
# File 'lib/oci/apm_traces/models/trace.rb', line 100

def service_summaries
  @service_summaries
end

#span_countInteger

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.

Returns:

  • (Integer)


39
40
41
# File 'lib/oci/apm_traces/models/trace.rb', line 39

def span_count
  @span_count
end

#span_summaryOCI::ApmTraces::Models::TraceSpanSummary



103
104
105
# File 'lib/oci/apm_traces/models/trace.rb', line 103

def span_summary
  @span_summary
end

#spansArray<OCI::ApmTraces::Models::Span>

**[Required]** An array of spans in the trace.

Returns:



108
109
110
# File 'lib/oci/apm_traces/models/trace.rb', line 108

def spans
  @spans
end

#time_earliest_span_startedDateTime

Start time of the earliest span in the span collection.

Returns:

  • (DateTime)


27
28
29
# File 'lib/oci/apm_traces/models/trace.rb', line 27

def time_earliest_span_started
  @time_earliest_span_started
end

#time_latest_span_endedDateTime

End time of the span that most recently ended in the span collection.

Returns:

  • (DateTime)


32
33
34
# File 'lib/oci/apm_traces/models/trace.rb', line 32

def time_latest_span_ended
  @time_latest_span_ended
end

#time_root_span_endedDateTime

End time of the root span for the span collection.

Returns:

  • (DateTime)


60
61
62
# File 'lib/oci/apm_traces/models/trace.rb', line 60

def time_root_span_ended
  @time_root_span_ended
end

#time_root_span_startedDateTime

Start time of the root span for the span collection.

Returns:

  • (DateTime)


55
56
57
# File 'lib/oci/apm_traces/models/trace.rb', line 55

def time_root_span_started
  @time_root_span_started
end

#trace_duration_in_msInteger

Time between the start of the earliest span and the end of the most recent span in milliseconds.

Returns:

  • (Integer)


70
71
72
# File 'lib/oci/apm_traces/models/trace.rb', line 70

def trace_duration_in_ms
  @trace_duration_in_ms
end

#trace_error_codeString

Error code of the trace.

Returns:

  • (String)


95
96
97
# File 'lib/oci/apm_traces/models/trace.rb', line 95

def trace_error_code
  @trace_error_code
end

#trace_error_typeString

Error type of the trace.

Returns:

  • (String)


90
91
92
# File 'lib/oci/apm_traces/models/trace.rb', line 90

def trace_error_type
  @trace_error_type
end

#trace_statusString

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.

Returns:

  • (String)


85
86
87
# File 'lib/oci/apm_traces/models/trace.rb', line 85

def trace_status
  @trace_status
end

Class Method Details

.attribute_mapObject

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



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/oci/apm_traces/models/trace.rb', line 111

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_typesObject

Attribute type mapping.



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

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.

Parameters:

  • other (Object)

    the other object to be compared



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/oci/apm_traces/models/trace.rb', line 300

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/oci/apm_traces/models/trace.rb', line 347

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


327
328
329
# File 'lib/oci/apm_traces/models/trace.rb', line 327

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



336
337
338
# File 'lib/oci/apm_traces/models/trace.rb', line 336

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_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



380
381
382
383
384
385
386
387
388
389
# File 'lib/oci/apm_traces/models/trace.rb', line 380

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



374
375
376
# File 'lib/oci/apm_traces/models/trace.rb', line 374

def to_s
  to_hash.to_s
end