Search in sources :

Example 6 with TIntStringValue

use of com.navercorp.pinpoint.thrift.dto.TIntStringValue in project pinpoint by naver.

the class SpanThriftMessageConverter method buildTIntStringValue.

private TIntStringValue buildTIntStringValue(IntStringValue exceptionInfo) {
    TIntStringValue tIntStringValue = new TIntStringValue(exceptionInfo.getIntValue());
    final String stringValue = exceptionInfo.getStringValue();
    if (stringValue != null) {
        tIntStringValue.setStringValue(stringValue);
    }
    return tIntStringValue;
}
Also used : TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue)

Example 7 with TIntStringValue

use of com.navercorp.pinpoint.thrift.dto.TIntStringValue in project pinpoint by naver.

the class SpanThriftMessageConverter method buildTSpanEvent.

@VisibleForTesting
TSpanEvent buildTSpanEvent(SpanEvent spanEvent) {
    final TSpanEvent tSpanEvent = new TSpanEvent();
    // tSpanEvent.setStartElapsed(spanEvent.getStartElapsed());
    if (spanEvent.getElapsedTime() != 0) {
        tSpanEvent.setEndElapsed(spanEvent.getElapsedTime());
    }
    tSpanEvent.setSequence((short) spanEvent.getSequence());
    // tSpanEvent.setRpc(spanEvent.getRpc());
    tSpanEvent.setServiceType(spanEvent.getServiceType());
    tSpanEvent.setEndPoint(spanEvent.getEndPoint());
    // tSpanEvent.setAnnotations();
    if (spanEvent.getDepth() != -1) {
        tSpanEvent.setDepth(spanEvent.getDepth());
    }
    if (spanEvent.getNextSpanId() != -1) {
        tSpanEvent.setNextSpanId(spanEvent.getNextSpanId());
    }
    tSpanEvent.setDestinationId(spanEvent.getDestinationId());
    tSpanEvent.setApiId(spanEvent.getApiId());
    final IntStringValue exceptionInfo = spanEvent.getExceptionInfo();
    if (exceptionInfo != null) {
        TIntStringValue tIntStringValue = buildTIntStringValue(exceptionInfo);
        tSpanEvent.setExceptionInfo(tIntStringValue);
    }
    final AsyncId asyncIdObject = spanEvent.getAsyncIdObject();
    if (asyncIdObject != null) {
        tSpanEvent.setNextAsyncId(asyncIdObject.getAsyncId());
    }
    final List<Annotation<?>> annotations = spanEvent.getAnnotations();
    if (CollectionUtils.hasLength(annotations)) {
        final List<TAnnotation> tAnnotations = buildTAnnotation(annotations);
        tSpanEvent.setAnnotations(tAnnotations);
    }
    return tSpanEvent;
}
Also used : TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) IntStringValue(com.navercorp.pinpoint.common.util.IntStringValue) TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) TLocalAsyncId(com.navercorp.pinpoint.thrift.dto.TLocalAsyncId) AsyncId(com.navercorp.pinpoint.profiler.context.AsyncId) LocalAsyncId(com.navercorp.pinpoint.profiler.context.LocalAsyncId) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) TAnnotation(com.navercorp.pinpoint.thrift.dto.TAnnotation) Annotation(com.navercorp.pinpoint.profiler.context.Annotation) TAnnotation(com.navercorp.pinpoint.thrift.dto.TAnnotation) VisibleForTesting(com.navercorp.pinpoint.common.annotations.VisibleForTesting)

Example 8 with TIntStringValue

use of com.navercorp.pinpoint.thrift.dto.TIntStringValue in project pinpoint by naver.

the class SpanEvent method setExceptionInfo.

public void setExceptionInfo(int exceptionClassId, String exceptionMessage) {
    final TIntStringValue exceptionInfo = new TIntStringValue(exceptionClassId);
    if (exceptionMessage != null && !exceptionMessage.isEmpty()) {
        exceptionInfo.setStringValue(exceptionMessage);
    }
    super.setExceptionInfo(exceptionInfo);
}
Also used : TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue)

Example 9 with TIntStringValue

use of com.navercorp.pinpoint.thrift.dto.TIntStringValue in project pinpoint by naver.

the class DataTypeAnnotation method apply.

@Override
public TAnnotationValue apply(AnnotationValueThriftMapper context) {
    final DataType dataType = this.value;
    if (dataType instanceof IntStringValue) {
        final IntStringValue v = (IntStringValue) dataType;
        final TIntStringValue tIntStringValue = new TIntStringValue(v.getIntValue());
        if (v.getStringValue() != null) {
            tIntStringValue.setStringValue(v.getStringValue());
        }
        return TAnnotationValue.intStringValue(tIntStringValue);
    } else if (dataType instanceof StringStringValue) {
        final StringStringValue v = (StringStringValue) dataType;
        final TStringStringValue tStringStringValue = new TStringStringValue(v.getStringValue1());
        if (v.getStringValue2() != null) {
            tStringStringValue.setStringValue2(v.getStringValue2());
        }
        return TAnnotationValue.stringStringValue(tStringStringValue);
    } else if (dataType instanceof IntStringStringValue) {
        final IntStringStringValue v = (IntStringStringValue) dataType;
        final TIntStringStringValue tIntStringStringValue = new TIntStringStringValue(v.getIntValue());
        if (v.getStringValue1() != null) {
            tIntStringStringValue.setStringValue1(v.getStringValue1());
        }
        if (v.getStringValue2() != null) {
            tIntStringStringValue.setStringValue2(v.getStringValue2());
        }
        return TAnnotationValue.intStringStringValue(tIntStringStringValue);
    } else if (dataType instanceof LongIntIntByteByteStringValue) {
        final LongIntIntByteByteStringValue v = (LongIntIntByteByteStringValue) dataType;
        final TLongIntIntByteByteStringValue tvalue = new TLongIntIntByteByteStringValue(v.getLongValue(), v.getIntValue1());
        if (v.getIntValue2() != -1) {
            tvalue.setIntValue2(v.getIntValue2());
        }
        if (v.getByteValue1() != -1) {
            tvalue.setByteValue1(v.getByteValue1());
        }
        if (v.getByteValue2() != -1) {
            tvalue.setByteValue2(v.getByteValue2());
        }
        if (v.getStringValue() != null) {
            tvalue.setStringValue(v.getStringValue());
        }
        return TAnnotationValue.longIntIntByteByteStringValue(tvalue);
    } else if (dataType instanceof IntBooleanIntBooleanValue) {
        final IntBooleanIntBooleanValue v = (IntBooleanIntBooleanValue) dataType;
        final TIntBooleanIntBooleanValue tvalue = new TIntBooleanIntBooleanValue(v.getIntValue1(), v.isBooleanValue1(), v.getIntValue2(), v.isBooleanValue2());
        return TAnnotationValue.intBooleanIntBooleanValue(tvalue);
    }
    throw new UnsupportedOperationException("unsupported type:" + dataType);
}
Also used : TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) TIntStringStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringStringValue) TLongIntIntByteByteStringValue(com.navercorp.pinpoint.thrift.dto.TLongIntIntByteByteStringValue) TStringStringValue(com.navercorp.pinpoint.thrift.dto.TStringStringValue) TIntBooleanIntBooleanValue(com.navercorp.pinpoint.thrift.dto.TIntBooleanIntBooleanValue) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue) StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) TStringStringValue(com.navercorp.pinpoint.thrift.dto.TStringStringValue) TIntStringStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringStringValue) TIntStringStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringStringValue) IntStringValue(com.navercorp.pinpoint.common.util.IntStringValue) PIntStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringValue) TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) IntBooleanIntBooleanValue(com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue) PIntBooleanIntBooleanValue(com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue) TIntBooleanIntBooleanValue(com.navercorp.pinpoint.thrift.dto.TIntBooleanIntBooleanValue) DataType(com.navercorp.pinpoint.common.util.DataType) TLongIntIntByteByteStringValue(com.navercorp.pinpoint.thrift.dto.TLongIntIntByteByteStringValue) PLongIntIntByteByteStringValue(com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue) LongIntIntByteByteStringValue(com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue)

Example 10 with TIntStringValue

use of com.navercorp.pinpoint.thrift.dto.TIntStringValue in project pinpoint by naver.

the class RandomTSpan method randomTSpan.

public TSpan randomTSpan() {
    final TSpan tSpan = new TSpan();
    tSpan.setAgentId("agentId");
    tSpan.setApplicationName("appName");
    tSpan.setAgentStartTime(System.currentTimeMillis());
    tSpan.setTransactionId(TransactionIdUtils.formatByteBuffer("agent", System.currentTimeMillis(), RandomUtils.nextLong(0, Long.MAX_VALUE)));
    tSpan.setSpanId(random.nextLong());
    tSpan.setParentSpanId(RandomUtils.nextInt(0, 100000));
    tSpan.setStartTime(System.currentTimeMillis() + RandomUtils.nextInt(0, 1000));
    tSpan.setElapsed(RandomUtils.nextInt(0, 2000));
    tSpan.setRpc(RandomStringUtils.random(10));
    tSpan.setServiceType(randomServerServiceType());
    tSpan.setEndPoint(RandomStringUtils.random(20));
    tSpan.setRemoteAddr(RandomStringUtils.random(20));
    List<TAnnotation> tAnnotationList = randomTAnnotationList();
    if (CollectionUtils.isNotEmpty(tAnnotationList)) {
        tSpan.setAnnotations(tAnnotationList);
    }
    tSpan.setFlag((short) RandomUtils.nextInt(0, 4));
    tSpan.setErr((short) RandomUtils.nextInt(0, 2));
    // tSpan.setSpanEventList()
    tSpan.setParentApplicationName("parentApp");
    tSpan.setParentApplicationType(randomServerServiceType());
    tSpan.setAcceptorHost("acceptHost");
    tSpan.setApiId(RandomUtils.nextInt(0, 5000));
    if (random.nextBoolean()) {
        tSpan.setApplicationServiceType(randomServerServiceType());
    } else {
        tSpan.setApplicationServiceType(tSpan.getServiceType());
    }
    if (random.nextBoolean()) {
        TIntStringValue exceptionInfo = new TIntStringValue();
        exceptionInfo.setIntValue(RandomUtils.nextInt(0, 5000));
        exceptionInfo.setStringValue(RandomStringUtils.random(100));
        tSpan.setExceptionInfo(exceptionInfo);
    }
    tSpan.setLoggingTransactionInfo((byte) RandomUtils.nextInt(0, 256));
    return tSpan;
}
Also used : TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) TSpan(com.navercorp.pinpoint.thrift.dto.TSpan) TAnnotation(com.navercorp.pinpoint.thrift.dto.TAnnotation)

Aggregations

TIntStringValue (com.navercorp.pinpoint.thrift.dto.TIntStringValue)13 TAnnotation (com.navercorp.pinpoint.thrift.dto.TAnnotation)4 IntStringValue (com.navercorp.pinpoint.common.util.IntStringValue)3 TSpanEvent (com.navercorp.pinpoint.thrift.dto.TSpanEvent)3 VisibleForTesting (com.navercorp.pinpoint.common.annotations.VisibleForTesting)2 AnnotationBo (com.navercorp.pinpoint.common.server.bo.AnnotationBo)2 Annotation (com.navercorp.pinpoint.profiler.context.Annotation)2 TSpan (com.navercorp.pinpoint.thrift.dto.TSpan)2 TraceId (com.navercorp.pinpoint.bootstrap.context.TraceId)1 AutomaticBuffer (com.navercorp.pinpoint.common.buffer.AutomaticBuffer)1 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)1 FixedBuffer (com.navercorp.pinpoint.common.buffer.FixedBuffer)1 TransactionId (com.navercorp.pinpoint.common.profiler.util.TransactionId)1 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)1 DataType (com.navercorp.pinpoint.common.util.DataType)1 IntBooleanIntBooleanValue (com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue)1 IntStringStringValue (com.navercorp.pinpoint.common.util.IntStringStringValue)1 LongIntIntByteByteStringValue (com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue)1 StringStringValue (com.navercorp.pinpoint.common.util.StringStringValue)1 TransactionId (com.navercorp.pinpoint.common.util.TransactionId)1