Class: OCI::ApmTraces::Models::TraceSpanSummary

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

Overview

Summary of the information pertaining to the spans in the trace window that is being queried.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TraceSpanSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 173

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']
end

Instance Attribute Details

#error_span_countInteger

[Required] 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)


46
47
48
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 46

def error_span_count
  @error_span_count
end

#is_faultBOOLEAN

[Required] Boolean flag that indicates whether the trace has an error.

Returns:

  • (BOOLEAN)


76
77
78
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 76

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)


17
18
19
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 17

def key
  @key
end

#root_span_duration_in_msInteger

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

Returns:

  • (Integer)


66
67
68
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 66

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)


23
24
25
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 23

def root_span_operation_name
  @root_span_operation_name
end

#root_span_service_nameString

Service associated with the trace.

Returns:

  • (String)


51
52
53
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 51

def root_span_service_name
  @root_span_service_name
end

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

A summary of the spans by service.



101
102
103
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 101

def service_summaries
  @service_summaries
end

#span_countInteger

[Required] 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)


40
41
42
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 40

def span_count
  @span_count
end

#time_earliest_span_startedDateTime

[Required] Start time of the earliest span in the span collection.

Returns:

  • (DateTime)


28
29
30
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 28

def time_earliest_span_started
  @time_earliest_span_started
end

#time_latest_span_endedDateTime

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

Returns:

  • (DateTime)


33
34
35
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 33

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)


61
62
63
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 61

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)


56
57
58
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 56

def time_root_span_started
  @time_root_span_started
end

#trace_duration_in_msInteger

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

Returns:

  • (Integer)


71
72
73
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 71

def trace_duration_in_ms
  @trace_duration_in_ms
end

#trace_error_codeString

[Required] Error code of the trace.

Returns:

  • (String)


96
97
98
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 96

def trace_error_code
  @trace_error_code
end

#trace_error_typeString

[Required] Error type of the trace.

Returns:

  • (String)


91
92
93
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 91

def trace_error_type
  @trace_error_type
end

#trace_statusString

[Required] 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)


86
87
88
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 86

def trace_status
  @trace_status
end

Class Method Details

.attribute_mapObject

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



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 104

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'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 128

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>'
    # 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



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 279

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
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



324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 324

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


304
305
306
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 304

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



313
314
315
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 313

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].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



357
358
359
360
361
362
363
364
365
366
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 357

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



351
352
353
# File 'lib/oci/apm_traces/models/trace_span_summary.rb', line 351

def to_s
  to_hash.to_s
end