class AppPerfRpm::Tracing::ManagedSpan
Public Class Methods
new(span, deactivate)
click to toggle source
# File lib/app_perf_rpm/tracing/managed_span.rb, line 10 def initialize(span, deactivate) @span = span @deactivate = deactivate.respond_to?(:call) ? deactivate : nil @active = true end
Public Instance Methods
active?()
click to toggle source
# File lib/app_perf_rpm/tracing/managed_span.rb, line 20 def active? @active end
deactivate()
click to toggle source
# File lib/app_perf_rpm/tracing/managed_span.rb, line 24 def deactivate if @active && @deactivate deactivated_span = @deactivate.call warn "ActiveSpan::SpanSource inconsistency found during deactivation" unless deactivated_span == self @active = false end end
finish(opts = {})
click to toggle source
# File lib/app_perf_rpm/tracing/managed_span.rb, line 32 def finish(opts = {}) opts[:end_time] ||= AppPerfRpm.now deactivate @span.finish(end_time: opts[:end_time]) end
wrapped()
click to toggle source
# File lib/app_perf_rpm/tracing/managed_span.rb, line 16 def wrapped @span end