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;
}
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;
}
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);
}
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);
}
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;
}
Aggregations