Class: Datadog::CI::ConcurrentSpan
- Defined in:
- lib/datadog/ci/concurrent_span.rb,
sig/datadog/ci/concurrent_span.rbs
Overview
Represents a single part of a test run that can be safely shared between threads. Examples of shared objects are: TestSession, TestModule, TestSpan.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Span
Instance Method Summary collapse
- #failed! ⇒ void
-
#finish ⇒ void
Finishes the span.
-
#get_tag(key) ⇒ String
Gets tag value by key.
-
#initialize(tracer_span) ⇒ ConcurrentSpan
constructor
A new instance of ConcurrentSpan.
- #passed! ⇒ void
- #set_default_tags ⇒ void
- #set_environment_runtime_tags ⇒ void
-
#set_metric(key, value) ⇒ void
Sets metric value by key.
-
#set_tag(key, value) ⇒ void
Sets tag value by key.
-
#set_tags(tags) ⇒ void
Sets multiple tags at once.
- #skipped! ⇒ void
- #synchronize { ... } ⇒ Object
Methods inherited from Span
#base_commit_sha, #clear_tag, #failed?, #get_metric, #git_branch, #git_commit_message, #git_commit_sha, #git_repository_url, #git_tag, #id, #name, #original_git_commit_message, #original_git_commit_sha, #os_architecture, #os_platform, #os_version, #passed?, #runtime_name, #runtime_version, #service, #set_parameters, #skipped?, #source_file, #status, #test_tracing, #to_s, #trace_id, #type, #undefined?
Constructor Details
#initialize(tracer_span) ⇒ ConcurrentSpan
Returns a new instance of ConcurrentSpan.
12 13 14 15 16 17 |
# File 'lib/datadog/ci/concurrent_span.rb', line 12 def initialize(tracer_span) super # we use Monitor instead of Mutex because it is reentrant @mutex = Monitor.new end |
Instance Method Details
#failed! ⇒ void
This method returns an undefined value.
8 |
# File 'sig/datadog/ci/concurrent_span.rbs', line 8
def failed!: (?exception: untyped?) -> void
|
#finish ⇒ void
This method returns an undefined value.
Finishes the span. This method is thread-safe.
44 45 46 |
# File 'lib/datadog/ci/concurrent_span.rb', line 44 def finish synchronize { super } end |
#get_tag(key) ⇒ String
Gets tag value by key. This method is thread-safe.
22 23 24 |
# File 'lib/datadog/ci/concurrent_span.rb', line 22 def get_tag(key) synchronize { super } end |
#passed! ⇒ void
This method returns an undefined value.
7 |
# File 'sig/datadog/ci/concurrent_span.rbs', line 7
def passed!: () -> void
|
#set_default_tags ⇒ void
This method returns an undefined value.
18 |
# File 'sig/datadog/ci/concurrent_span.rbs', line 18
def set_default_tags: () -> void
|
#set_environment_runtime_tags ⇒ void
This method returns an undefined value.
16 |
# File 'sig/datadog/ci/concurrent_span.rbs', line 16
def set_environment_runtime_tags: () -> void
|
#set_metric(key, value) ⇒ void
This method returns an undefined value.
Sets metric value by key. This method is thread-safe.
38 39 40 |
# File 'lib/datadog/ci/concurrent_span.rb', line 38 def set_metric(key, value) synchronize { super } end |
#set_tag(key, value) ⇒ void
This method returns an undefined value.
Sets tag value by key. This method is thread-safe.
30 31 32 |
# File 'lib/datadog/ci/concurrent_span.rb', line 30 def set_tag(key, value) synchronize { super } end |
#set_tags(tags) ⇒ void
This method returns an undefined value.
Sets multiple tags at once. This method is thread-safe.
51 52 53 |
# File 'lib/datadog/ci/concurrent_span.rb', line 51 def () synchronize { super } end |
#skipped! ⇒ void
This method returns an undefined value.
9 |
# File 'sig/datadog/ci/concurrent_span.rbs', line 9
def skipped!: (?exception: untyped?, ?reason: String?) -> void
|
#synchronize { ... } ⇒ Object
55 56 57 |
# File 'lib/datadog/ci/concurrent_span.rb', line 55 def synchronize @mutex.synchronize { yield } end |