/** * Create an annotation with the correct times and endpoint. * * @param value Annotation value * @param time timestamp will be extracted * @param ep the endopint this annotation will be associated with. * @param sendRequest use the first or last timestamp. */ private static Annotation createZipkinAnnotation(String value, long time, Endpoint ep, boolean sendRequest) { Annotation annotation = new Annotation(); annotation.setHost(ep); // Zipkin is in microseconds if (sendRequest) { annotation.setTimestamp(time * 1000); } else { annotation.setTimestamp(time * 1000); } annotation.setValue(value); return annotation; }
/** * Create an annotation with the correct times and endpoint. * * @param value Annotation value * @param time timestamp will be extracted * @param ep the endopint this annotation will be associated with. * @param sendRequest use the first or last timestamp. */ private static Annotation createZipkinAnnotation(String value, long time, Endpoint ep, boolean sendRequest) { Annotation annotation = new Annotation(); annotation.setHost(ep); // Zipkin is in microseconds if (sendRequest) { annotation.setTimestamp(time * 1000); } else { annotation.setTimestamp(time * 1000); } annotation.setValue(value); return annotation; }
/** * Create an annotation with the correct times and endpoint. * * @param value Annotation value * @param time timestamp will be extracted * @param ep the endopint this annotation will be associated with. * @param sendRequest use the first or last timestamp. */ private static Annotation createZipkinAnnotation(String value, long time, Endpoint ep, boolean sendRequest) { Annotation annotation = new Annotation(); annotation.setHost(ep); // Zipkin is in microseconds if (sendRequest) { annotation.setTimestamp(time * 1000); } else { annotation.setTimestamp(time * 1000); } annotation.setDuration(1); annotation.setValue(value); return annotation; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case TIMESTAMP: if (value == null) { unsetTimestamp(); } else { setTimestamp((Long)value); } break; case VALUE: if (value == null) { unsetValue(); } else { setValue((String)value); } break; case HOST: if (value == null) { unsetHost(); } else { setHost((Endpoint)value); } break; } }
public void setFieldValue(_Fields field, Object value) { switch (field) { case TIMESTAMP: if (value == null) { unsetTimestamp(); } else { setTimestamp((Long)value); } break; case VALUE: if (value == null) { unsetValue(); } else { setValue((String)value); } break; case HOST: if (value == null) { unsetHost(); } else { setHost((Endpoint)value); } break; } }
/** * {@inheritDoc} */ @Override public void submitAnnotation(final String annotationName) { final Span span = getSpan(); if (span != null) { final Annotation annotation = new Annotation(); annotation.setTimestamp(currentTimeMicroseconds()); annotation.setHost(getEndPoint()); annotation.setValue(annotationName); addAnnotation(span, annotation); } }
/** * {@inheritDoc} */ @Override public void submitAnnotation(final String annotationName, final long startTime, final long endTime) { final Span span = getSpan(); if (span != null) { final Annotation annotation = new Annotation(); final int duration = (int)(endTime - startTime); annotation.setTimestamp(startTime * 1000); annotation.setHost(getEndPoint()); annotation.setDuration(duration * 1000); // Duration is currently not supported in the ZipkinUI, so also add it as part of the annotation name. annotation.setValue(annotationName + "=" + duration + "ms"); addAnnotation(span, annotation); } }
unsetValue(); } else { setValue((String)value);