Package com.twitter.zipkin.gen

Examples of com.twitter.zipkin.gen.Annotation


        final long startDateMs = 1000;
        final long endDateMs = 2000;
        final int durationMs = (int)(endDateMs - startDateMs);
        abstractAnnotationSubmitter.submitAnnotation(ANNOTATION_NAME, startDateMs, endDateMs);

        final Annotation expectedAnnotation = new Annotation();
        expectedAnnotation.setHost(endPoint);
        expectedAnnotation.setValue(ANNOTATION_NAME + "=" + durationMs + "ms");
        expectedAnnotation.setTimestamp(startDateMs * 1000);
        expectedAnnotation.setDuration(durationMs * 1000);
        verify(mockSpan).addToAnnotations(expectedAnnotation);
        verifyNoMoreInteractions(mockSpan);
    }
View Full Code Here


    @Test
    public void testSubmitAnnotationSpanEndpointString() {
        abstractAnnotationSubmitter.submitAnnotation(ANNOTATION_NAME);

        final Annotation expectedAnnotation = new Annotation();
        expectedAnnotation.setHost(endPoint);
        expectedAnnotation.setValue(ANNOTATION_NAME);
        expectedAnnotation.setTimestamp(CURRENT_TIME);

        verify(mockSpan).addToAnnotations(expectedAnnotation);
        verifyNoMoreInteractions(mockSpan);
    }
View Full Code Here

        when(mockState.getCurrentClientSpan()).thenReturn(mockSpan);
        when(mockState.getClientEndPoint()).thenReturn(endPoint);
        clientTracer.setClientSent();

        final Annotation expectedAnnotation = new Annotation();
        expectedAnnotation.setHost(endPoint);
        expectedAnnotation.setValue(zipkinCoreConstants.CLIENT_SEND);
        expectedAnnotation.setTimestamp(CURRENT_TIME_MICROSECONDS);
        verify(mockState).getCurrentClientSpan();
        verify(mockState).getClientEndPoint();
        verify(mockSpan).addToAnnotations(expectedAnnotation);
        verifyNoMoreInteractions(mockState, mockRandom, mockSpan, mockCollector, mockTraceFilter, mockTraceFilter2);
    }
View Full Code Here

        when(mockState.getCurrentClientSpan()).thenReturn(mockSpan);
        when(mockState.getClientEndPoint()).thenReturn(endPoint);
        clientTracer.setClientReceived();

        final Annotation expectedAnnotation = new Annotation();
        expectedAnnotation.setHost(endPoint);
        expectedAnnotation.setValue(zipkinCoreConstants.CLIENT_RECV);
        expectedAnnotation.setTimestamp(CURRENT_TIME_MICROSECONDS);
        verify(mockState, times(2)).getCurrentClientSpan();
        verify(mockState).getClientEndPoint();
        verify(mockState).setCurrentClientSpan(null);
        verify(mockState).setCurrentClientServiceName(null);
        verify(mockSpan).addToAnnotations(expectedAnnotation);
View Full Code Here

     */
    @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);
        }
    }
View Full Code Here

     */
    @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);
        }

    }
View Full Code Here

        when(mockServerSpan.getSpan()).thenReturn(mockSpan);
        when(mockServerSpanState.getCurrentServerSpan()).thenReturn(mockServerSpan);
        when(mockServerSpanState.getServerEndPoint()).thenReturn(mockEndPoint);
        serverTracer.setServerReceived();

        final Annotation expectedAnnotation = new Annotation();
        expectedAnnotation.setHost(mockEndPoint);
        expectedAnnotation.setValue(zipkinCoreConstants.SERVER_RECV);
        expectedAnnotation.setTimestamp(CURRENT_TIME_MICROSECONDS);

        verify(mockServerSpanState).getCurrentServerSpan();
        verify(mockServerSpanState).getServerEndPoint();
        verify(mockSpan).addToAnnotations(expectedAnnotation);
View Full Code Here

        when(mockServerSpan.getSpan()).thenReturn(mockSpan);
        when(mockServerSpanState.getCurrentServerSpan()).thenReturn(mockServerSpan);
        when(mockServerSpanState.getServerEndPoint()).thenReturn(mockEndPoint);
        serverTracer.setServerSend();

        final Annotation expectedAnnotation = new Annotation();
        expectedAnnotation.setHost(mockEndPoint);
        expectedAnnotation.setValue(zipkinCoreConstants.SERVER_SEND);
        expectedAnnotation.setTimestamp(CURRENT_TIME_MICROSECONDS);

        verify(mockServerSpanState, times(2)).getCurrentServerSpan();
        verify(mockServerSpanState).getServerEndPoint();

        verify(mockSpan).addToAnnotations(expectedAnnotation);
View Full Code Here

        when(mockServerSpanState.getServerEndPoint()).thenReturn(mockEndPoint);
        serverTracer.setServerSend();
        verify(mockServerSpanState, times(3)).getCurrentServerSpan();
        verify(mockServerSpanState, times(2)).getServerEndPoint();

        final Annotation expectedServerSendAnnotation = new Annotation();
        expectedServerSendAnnotation.setHost(mockEndPoint);
        expectedServerSendAnnotation.setValue(zipkinCoreConstants.SERVER_SEND);
        expectedServerSendAnnotation.setTimestamp(CURRENT_TIME_MICROSECONDS);

        final BinaryAnnotation expectedThreadDurationAnnotation = new BinaryAnnotation();
        expectedThreadDurationAnnotation.setAnnotation_type(AnnotationType.STRING);
        expectedThreadDurationAnnotation.setHost(mockEndPoint);
        expectedThreadDurationAnnotation.setKey(BraveAnnotations.THREAD_DURATION);
View Full Code Here

TOP

Related Classes of com.twitter.zipkin.gen.Annotation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.