Class: Trace::NullSender

Inherits:
Object
  • Object
show all
Defined in:
lib/zipkin-tracer/zipkin_null_sender.rb

Instance Method Summary collapse

Instance Method Details

#end_span(span, timestamp = Time.now) ⇒ Object


14
15
16
# File 'lib/zipkin-tracer/zipkin_null_sender.rb', line 14

def end_span(span, timestamp = Time.now)
  span.close(timestamp) if span.respond_to?(:close)
end

#flush!Object


18
19
20
# File 'lib/zipkin-tracer/zipkin_null_sender.rb', line 18

def flush!
  # NOOP
end

#start_span(trace_id, name, timestamp = Time.now) ⇒ Object


10
11
12
# File 'lib/zipkin-tracer/zipkin_null_sender.rb', line 10

def start_span(trace_id, name, timestamp = Time.now)
  Span.new(name, trace_id, timestamp)
end

#with_new_span(trace_id, name) ⇒ Object


3
4
5
6
7
8
# File 'lib/zipkin-tracer/zipkin_null_sender.rb', line 3

def with_new_span(trace_id, name)
  span = start_span(trace_id, name)
  result = yield span
  end_span(span)
  result
end