Examples of Span


Examples of com.twitter.zipkin.gen.Span

    /**
     * {@inheritDoc}
     */
    @Override
    public void setServerSend() {
        final Span currentSpan = state.getCurrentServerSpan().getSpan();
        if (currentSpan != null) {
            submitAnnotation(zipkinCoreConstants.SERVER_SEND);
            final long threadDuration = state.getServerSpanThreadDuration();
            if (threadDuration > 0) {
                submitBinaryAnnotation(BraveAnnotations.THREAD_DURATION, String.valueOf(threadDuration));
View Full Code Here

Examples of com.twitter.zipkin.gen.Span

     * {@inheritDoc}
     */
    @Override
    public void setClientReceived() {

        final Span currentSpan = getSpan();
        if (currentSpan != null) {
            submitAnnotation(zipkinCoreConstants.CLIENT_RECV);
            spanCollector.collect(currentSpan);
            state.setCurrentClientSpan(null);
            state.setCurrentClientServiceName(null);
View Full Code Here

Examples of com.twitter.zipkin.gen.Span

                }
            }
        }

        final SpanId newSpanId = getNewSpanId();
        final Span newSpan = new Span();
        newSpan.setId(newSpanId.getSpanId());
        newSpan.setTrace_id(newSpanId.getTraceId());
        if (newSpanId.getParentSpanId() != null) {
            newSpan.setParent_id(newSpanId.getParentSpanId());
        }
        newSpan.setName(requestName);
        state.setCurrentClientSpan(newSpan);
        return newSpanId;
    }
View Full Code Here

Examples of com.twitter.zipkin.gen.Span

        return Collections.unmodifiableList(traceFilters);
    }

    private SpanId getNewSpanId() {

        final Span currentServerSpan = state.getCurrentServerSpan().getSpan();
        final long newSpanId = randomGenerator.nextLong();
        if (currentServerSpan == null) {
            return new SpanIdImpl(newSpanId, newSpanId, null);
        }

        return new SpanIdImpl(currentServerSpan.getTrace_id(), newSpanId, currentServerSpan.getId());
    }
View Full Code Here

Examples of com.twitter.zipkin.gen.Span

public class EmptySpanCollectorImplTest {

    @Test
    public void testCollect() {
        final EmptySpanCollectorImpl emptySpanCollectorImpl = new EmptySpanCollectorImpl();
        final Span mockSpan = mock(Span.class);
        emptySpanCollectorImpl.collect(mockSpan);
        verifyNoMoreInteractions(mockSpan);
    }
View Full Code Here

Examples of com.twitter.zipkin.gen.Span

        assertNotNull(newSpanId);
        assertEquals(1l, newSpanId.getTraceId());
        assertEquals(1l, newSpanId.getSpanId());
        assertNull(newSpanId.getParentSpanId());

        final Span expectedSpan = new Span();
        expectedSpan.setTrace_id(1);
        expectedSpan.setId(1);
        expectedSpan.setName(REQUEST_NAME);

        verify(mockState).sample();
        verify(mockTraceFilter).trace(REQUEST_NAME);
        verify(mockTraceFilter2).trace(REQUEST_NAME);
        verify(mockRandom, times(1)).nextLong();
View Full Code Here

Examples of com.twitter.zipkin.gen.Span

        assertNotNull(newSpanId);
        assertEquals(1l, newSpanId.getTraceId());
        assertEquals(1l, newSpanId.getSpanId());
        assertNull(newSpanId.getParentSpanId());

        final Span expectedSpan = new Span();
        expectedSpan.setTrace_id(1);
        expectedSpan.setId(1);
        expectedSpan.setName(REQUEST_NAME);

        verify(mockState).sample();
        verify(mockRandom, times(1)).nextLong();
        verify(mockState).getCurrentServerSpan();
        verify(mockState).setCurrentClientSpan(expectedSpan);
View Full Code Here

Examples of com.twitter.zipkin.gen.Span

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

Examples of com.twitter.zipkin.gen.Span

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

Examples of com.twitter.zipkin.gen.Span

    /**
     * {@inheritDoc}
     */
    @Override
    public void submitBinaryAnnotation(final String key, final String value) {
        final Span span = getSpan();
        if (span != null) {
            Validate.notNull(value);
            final ByteBuffer bb = ByteBuffer.wrap(value.getBytes(UTF_8));
            submitBinaryAnnotation(span, getEndPoint(), key, bb, AnnotationType.STRING);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.