/** * Associates an event that explains latency with a timestamp. * * <p/> This is an alternative to {@link #submitAnnotation(String)}, when * you have a timestamp more precise or accurate than {@link System#currentTimeMillis()}. * * @param value A short tag indicating the event, like "finagle.retry" * @param timestamp microseconds from epoch */ public void submitAnnotation(String value, long timestamp) { Span span = currentSpan().get(); if (span == null) return; recorder().annotate(span, timestamp, value); }
/** * Associates an event that explains latency with the current system time. * * @param value A short tag indicating the event, like "finagle.retry" */ public void submitAnnotation(String value) { Span span = currentSpan().get(); if (span == null) return; recorder().annotate(span, recorder().currentTimeMicroseconds(span), value); }
/** This adds an annotation that corresponds with {@link Span#getTimestamp()} */ void submitStartAnnotation(String startAnnotation) { Span span = currentSpan().get(); if (span == null) return; long timestamp = recorder().currentTimeMicroseconds(span); recorder().annotate(span, timestamp, startAnnotation); recorder().start(span, timestamp); }
/** * This adds an annotation that corresponds with {@link Span#getDuration()}, and sends the span * for collection. * * @return true if a span was sent for collection. */ boolean submitEndAnnotation(String finishAnnotation) { Span span = currentSpan().get(); if (span == null) return false; long timestamp = recorder().currentTimeMicroseconds(span); recorder().annotate(span, timestamp, finishAnnotation); recorder().finish(span, timestamp); return true; }