Package com.twitter.zipkin.gen

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


        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

    /**
     * {@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

    /**
     * {@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

    /**
     * {@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

        assertNotNull(newSpanId);
        assertEquals(PARENT_TRACE_ID, newSpanId.getTraceId());
        assertEquals(1l, newSpanId.getSpanId());
        assertEquals(Long.valueOf(PARENT_SPAN_ID), newSpanId.getParentSpanId());

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

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

    private Span span;

    @Before
    public void setup() {
        executorService = Executors.newFixedThreadPool(4);
        span = new Span();
    }
View Full Code Here

        };
    }

    @Test
    public void testCollect() {
        final Span mockSpan = mock(Span.class);
        spanCollector.collect(mockSpan);
        verify(mockLogger).isInfoEnabled();
        verifyNoMoreInteractions(mockLogger, mockSpan);
    }
View Full Code Here

    @Test
    public void testCollectAfterAddingDefaultAnnotations() {

        spanCollector.addDefaultAnnotation(KEY1, VALUE1);

        final Span mockSpan = mock(Span.class);
        spanCollector.collect(mockSpan);

        // Create expected annotation.
        final BinaryAnnotation expectedBinaryAnnoration = create(KEY1, VALUE1);
View Full Code Here

    public void testCollectAfterAddingTwoDefaultAnnotations() {

        spanCollector.addDefaultAnnotation(KEY1, VALUE1);
        spanCollector.addDefaultAnnotation(KEY2, VALUE2);

        final Span mockSpan = mock(Span.class);
        spanCollector.collect(mockSpan);

        // Create expected annotations.
        final BinaryAnnotation expectedBinaryAnnoration = create(KEY1, VALUE1);
        final BinaryAnnotation expectedBinaryAnnoration2 = create(KEY2, VALUE2);
View Full Code Here

TOP

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

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.