@Test public void testFinishAfterFinish() { InMemoryDispatcher dispatcher = new InMemoryDispatcher.Builder(metrics).build(); tracer = new Tracer.Builder(metrics, "remote-dispatcher", dispatcher).build(); Span span = tracer.buildSpan("operation").start(); span.finish(); try { span.finish(); Assert.fail(); } catch (IllegalStateException ex) { } try { dispatcher.flush(); } catch (IOException ex) { Assert.fail(); } Assert.assertEquals(0, dispatcher.getReportedSpans().size()); Assert.assertEquals(1, dispatcher.getFlushedSpans().size()); Assert.assertEquals(1, dispatcher.getReceivedSpans().size()); }
@Override public void finish() { finishTrace(clock.microTime()); }
Span implements io.opentracing.Span { @Override public void finish() { finishTrace(clock.microTime()); } }
Span implements io.opentracing.Span { @Override public void finish() { finishTrace(clock.microTime()); } Span(Tracer tracer, Clock clock, String operationName, SpanContext context, long startTime, Map<String, Object> tags, List<Reference> references); }
Span implements io.opentracing.Span { @Override public void finish() { finishTrace(clock.microTime()); } Span(Tracer tracer, Clock clock, String operationName, SpanContext context, long startTime, Map<String, Object> tags, List<Reference> references); @Override String toString(); @Override void finish(); @Override void finish(long finishMicros); Long getDuration(); Long getStartTime(); Tracer getTracer(); @Override SpanContext context(); String getServiceName(); String getOperationName(); @Override Span setOperationName(String operationName); @Override Span setBaggageItem(String key, String value); @Override String getBaggageItem(String key); Map<String, String> getBaggageItems(); @Override Span setTag(String key, Number value); @Override io.opentracing.Span setTag(Tag<T> tag, T value); @Override Span setTag(String key, boolean value); @Override Span setTag(String key, String value); Map<String, Object> getTags(); @Override Span log(long timestampMicroseconds, Map<String, ?> fields); @Override Span log(long timestampMicroseconds, String event); @Override Span log(Map<String, ?> fields); @Override Span log(String event); List<LogData> getLogs(); }
Span implements io.opentracing.Span { @Override public void finish() { finishTrace(clock.microTime()); } Span(Tracer tracer, Clock clock, String operationName, SpanContext context, long startTime, Map<String, Object> tags, List<Reference> references); @Override String toString(); @Override void finish(); @Override void finish(long finishMicros); Long getDuration(); Long getStartTime(); Tracer getTracer(); @Override SpanContext context(); String getServiceName(); String getOperationName(); @Override Span setOperationName(String operationName); @Override Span setBaggageItem(String key, String value); @Override String getBaggageItem(String key); Map<String, String> getBaggageItems(); @Override Span setTag(String key, Number value); @Override io.opentracing.Span setTag(Tag<T> tag, T value); @Override Span setTag(String key, boolean value); @Override Span setTag(String key, String value); Map<String, Object> getTags(); @Override Span log(long timestampMicroseconds, Map<String, ?> fields); @Override Span log(long timestampMicroseconds, String event); @Override Span log(Map<String, ?> fields); @Override Span log(String event); List<LogData> getLogs();  }