Class: AppPerfRpm::Tracing::ManagedTracer
- Inherits:
-
Object
- Object
- AppPerfRpm::Tracing::ManagedTracer
- Extended by:
- Forwardable
- Defined in:
- lib/app_perf_rpm/tracing/managed_tracer.rb
Instance Attribute Summary collapse
-
#thread_span_stack ⇒ Object
readonly
Returns the value of attribute thread_span_stack.
Instance Method Summary collapse
- #active_span ⇒ Object
- #collector ⇒ Object
-
#initialize(tracer, thread_span_stack = ThreadSpanStack.new) ⇒ ManagedTracer
constructor
A new instance of ManagedTracer.
- #start_span(operation_name, opts = {}, *args) ⇒ Object
- #wrapped ⇒ Object
Constructor Details
#initialize(tracer, thread_span_stack = ThreadSpanStack.new) ⇒ ManagedTracer
Returns a new instance of ManagedTracer.
11 12 13 14 |
# File 'lib/app_perf_rpm/tracing/managed_tracer.rb', line 11 def initialize(tracer, thread_span_stack = ThreadSpanStack.new) @tracer = tracer @thread_span_stack = thread_span_stack end |
Instance Attribute Details
#thread_span_stack ⇒ Object (readonly)
Returns the value of attribute thread_span_stack.
9 10 11 |
# File 'lib/app_perf_rpm/tracing/managed_tracer.rb', line 9 def thread_span_stack @thread_span_stack end |
Instance Method Details
#active_span ⇒ Object
24 25 26 |
# File 'lib/app_perf_rpm/tracing/managed_tracer.rb', line 24 def active_span thread_span_stack.active_span end |
#collector ⇒ Object
20 21 22 |
# File 'lib/app_perf_rpm/tracing/managed_tracer.rb', line 20 def collector @tracer.collector end |
#start_span(operation_name, opts = {}, *args) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/app_perf_rpm/tracing/managed_tracer.rb', line 28 def start_span(operation_name, opts = {}, *args) opts[:child_of] ||= active_span span = @tracer.start_span(operation_name, opts, *args) @thread_span_stack.set_active_span(span) end |
#wrapped ⇒ Object
16 17 18 |
# File 'lib/app_perf_rpm/tracing/managed_tracer.rb', line 16 def wrapped @tracer end |