Class: OCI::ApmTraces::Models::Span
- Inherits:
-
Object
- Object
- OCI::ApmTraces::Models::Span
- Defined in:
- lib/oci/apm_traces/models/span.rb
Overview
Definition of a span object.
Instance Attribute Summary collapse
-
#duration_in_ms ⇒ Integer
**[Required]** Total span duration in milliseconds.
-
#is_error ⇒ BOOLEAN
**[Required]** Indicates if the span has an error.
-
#key ⇒ String
**[Required]** Unique identifier (spanId) for the span.
-
#kind ⇒ String
Kind associated with the span.
-
#logs ⇒ Array<OCI::ApmTraces::Models::SpanLogCollection>
List of logs associated with the span.
-
#operation_name ⇒ String
**[Required]** Span name associated with the trace.
-
#parent_span_key ⇒ String
Unique parent identifier for the span if one exists.
-
#service_name ⇒ String
Service name associated with the span.
-
#tags ⇒ Array<OCI::ApmTraces::Models::Tag>
List of tags associated with the span.
-
#time_ended ⇒ DateTime
**[Required]** Span end time.
-
#time_started ⇒ DateTime
**[Required]** Span start time.
-
#trace_key ⇒ String
**[Required]** Unique identifier for 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 = {}) ⇒ Span
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 = {}) ⇒ Span
Initializes the object
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/oci/apm_traces/models/span.rb', line 131 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.parent_span_key = attributes[:'parentSpanKey'] if attributes[:'parentSpanKey'] raise 'You cannot provide both :parentSpanKey and :parent_span_key' if attributes.key?(:'parentSpanKey') && attributes.key?(:'parent_span_key') self.parent_span_key = attributes[:'parent_span_key'] if attributes[:'parent_span_key'] self.trace_key = attributes[:'traceKey'] if attributes[:'traceKey'] raise 'You cannot provide both :traceKey and :trace_key' if attributes.key?(:'traceKey') && attributes.key?(:'trace_key') self.trace_key = attributes[:'trace_key'] if attributes[:'trace_key'] self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted'] raise 'You cannot provide both :timeStarted and :time_started' if attributes.key?(:'timeStarted') && attributes.key?(:'time_started') self.time_started = attributes[:'time_started'] if attributes[:'time_started'] self.time_ended = attributes[:'timeEnded'] if attributes[:'timeEnded'] raise 'You cannot provide both :timeEnded and :time_ended' if attributes.key?(:'timeEnded') && attributes.key?(:'time_ended') self.time_ended = attributes[:'time_ended'] if attributes[:'time_ended'] self.duration_in_ms = attributes[:'durationInMs'] if attributes[:'durationInMs'] raise 'You cannot provide both :durationInMs and :duration_in_ms' if attributes.key?(:'durationInMs') && attributes.key?(:'duration_in_ms') self.duration_in_ms = attributes[:'duration_in_ms'] if attributes[:'duration_in_ms'] self.operation_name = attributes[:'operationName'] if attributes[:'operationName'] raise 'You cannot provide both :operationName and :operation_name' if attributes.key?(:'operationName') && attributes.key?(:'operation_name') self.operation_name = attributes[:'operation_name'] if attributes[:'operation_name'] self.service_name = attributes[:'serviceName'] if attributes[:'serviceName'] raise 'You cannot provide both :serviceName and :service_name' if attributes.key?(:'serviceName') && attributes.key?(:'service_name') self.service_name = attributes[:'service_name'] if attributes[:'service_name'] self.kind = attributes[:'kind'] if attributes[:'kind'] self. = attributes[:'tags'] if attributes[:'tags'] self.logs = attributes[:'logs'] if attributes[:'logs'] self.is_error = attributes[:'isError'] unless attributes[:'isError'].nil? raise 'You cannot provide both :isError and :is_error' if attributes.key?(:'isError') && attributes.key?(:'is_error') self.is_error = attributes[:'is_error'] unless attributes[:'is_error'].nil? end |
Instance Attribute Details
#duration_in_ms ⇒ Integer
**[Required]** Total span duration in milliseconds.
41 42 43 |
# File 'lib/oci/apm_traces/models/span.rb', line 41 def duration_in_ms @duration_in_ms end |
#is_error ⇒ BOOLEAN
**[Required]** Indicates if the span has an error.
71 72 73 |
# File 'lib/oci/apm_traces/models/span.rb', line 71 def is_error @is_error end |
#key ⇒ String
**[Required]** Unique identifier (spanId) for the span. Note that this field is defined as spanKey in the API and it maps to the spanId in the trace data in Application Performance Monitoring.
16 17 18 |
# File 'lib/oci/apm_traces/models/span.rb', line 16 def key @key end |
#kind ⇒ String
Kind associated with the span.
56 57 58 |
# File 'lib/oci/apm_traces/models/span.rb', line 56 def kind @kind end |
#logs ⇒ Array<OCI::ApmTraces::Models::SpanLogCollection>
List of logs associated with the span.
66 67 68 |
# File 'lib/oci/apm_traces/models/span.rb', line 66 def logs @logs end |
#operation_name ⇒ String
**[Required]** Span name associated with the trace. This is usually the method or URI of the request.
46 47 48 |
# File 'lib/oci/apm_traces/models/span.rb', line 46 def operation_name @operation_name end |
#parent_span_key ⇒ String
Unique parent identifier for the span if one exists. For root spans this will be null.
21 22 23 |
# File 'lib/oci/apm_traces/models/span.rb', line 21 def parent_span_key @parent_span_key end |
#service_name ⇒ String
Service name associated with the span.
51 52 53 |
# File 'lib/oci/apm_traces/models/span.rb', line 51 def service_name @service_name end |
#tags ⇒ Array<OCI::ApmTraces::Models::Tag>
List of tags associated with the span.
61 62 63 |
# File 'lib/oci/apm_traces/models/span.rb', line 61 def @tags end |
#time_ended ⇒ DateTime
**[Required]** Span end time. Timestamp when the span was completed.
36 37 38 |
# File 'lib/oci/apm_traces/models/span.rb', line 36 def time_ended @time_ended end |
#time_started ⇒ DateTime
**[Required]** Span start time. Timestamp when the span was started.
31 32 33 |
# File 'lib/oci/apm_traces/models/span.rb', line 31 def time_started @time_started end |
#trace_key ⇒ String
**[Required]** Unique identifier for the trace.
26 27 28 |
# File 'lib/oci/apm_traces/models/span.rb', line 26 def trace_key @trace_key end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/oci/apm_traces/models/span.rb', line 74 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'key': :'key', 'parent_span_key': :'parentSpanKey', 'trace_key': :'traceKey', 'time_started': :'timeStarted', 'time_ended': :'timeEnded', 'duration_in_ms': :'durationInMs', 'operation_name': :'operationName', 'service_name': :'serviceName', 'kind': :'kind', 'tags': :'tags', 'logs': :'logs', 'is_error': :'isError' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/oci/apm_traces/models/span.rb', line 94 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'key': :'String', 'parent_span_key': :'String', 'trace_key': :'String', 'time_started': :'DateTime', 'time_ended': :'DateTime', 'duration_in_ms': :'Integer', 'operation_name': :'String', 'service_name': :'String', 'kind': :'String', 'tags': :'Array<OCI::ApmTraces::Models::Tag>', 'logs': :'Array<OCI::ApmTraces::Models::SpanLogCollection>', 'is_error': :'BOOLEAN' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/oci/apm_traces/models/span.rb', line 201 def ==(other) return true if equal?(other) self.class == other.class && key == other.key && parent_span_key == other.parent_span_key && trace_key == other.trace_key && time_started == other.time_started && time_ended == other.time_ended && duration_in_ms == other.duration_in_ms && operation_name == other.operation_name && service_name == other.service_name && kind == other.kind && == other. && logs == other.logs && is_error == other.is_error end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/oci/apm_traces/models/span.rb', line 242 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
222 223 224 |
# File 'lib/oci/apm_traces/models/span.rb', line 222 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
231 232 233 |
# File 'lib/oci/apm_traces/models/span.rb', line 231 def hash [key, parent_span_key, trace_key, time_started, time_ended, duration_in_ms, operation_name, service_name, kind, , logs, is_error].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
275 276 277 278 279 280 281 282 283 284 |
# File 'lib/oci/apm_traces/models/span.rb', line 275 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
269 270 271 |
# File 'lib/oci/apm_traces/models/span.rb', line 269 def to_s to_hash.to_s end |