lib/jaeger/client/span.rb in jaeger-client-0.6.1 vs lib/jaeger/client/span.rb in jaeger-client-0.7.0

- old
+ new

@@ -6,23 +6,23 @@ module Jaeger module Client class Span attr_accessor :operation_name - attr_reader :context, :start_time, :references, :tags, :logs + attr_reader :context, :start_time, :end_time, :references, :tags, :logs # Creates a new {Span} # # @param context [SpanContext] the context of the span # @param operation_name [String] the operation name - # @param collector [Collector] span collector + # @param reporter [#report] span reporter # # @return [Span] a new Span - def initialize(context, operation_name, collector, start_time: Time.now, references: [], tags: {}) + def initialize(context, operation_name, reporter, start_time: Time.now, references: [], tags: {}) @context = context @operation_name = operation_name - @collector = collector + @reporter = reporter @start_time = start_time @references = references @tags = tags.map { |key, value| ThriftTagBuilder.build(key, value) } @logs = [] end @@ -74,10 +74,11 @@ # Finish the {Span} # # @param end_time [Time] custom end time, if not now def finish(end_time: Time.now) - @collector.send_span(self, end_time) + @end_time = end_time + @reporter.report(self) end end end end