use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class GrpcSpanBinder method newSpanChunkBo.
// for test
SpanChunkBo newSpanChunkBo(PSpanChunk pSpanChunk, Header header) {
final SpanChunkBo spanChunkBo = new SpanChunkBo();
spanChunkBo.setVersion(pSpanChunk.getVersion());
spanChunkBo.setAgentId(header.getAgentId());
spanChunkBo.setApplicationId(header.getApplicationName());
spanChunkBo.setAgentStartTime(header.getAgentStartTime());
spanChunkBo.setApplicationServiceType((short) pSpanChunk.getApplicationServiceType());
if (pSpanChunk.hasTransactionId()) {
PTransactionId pTransactionId = pSpanChunk.getTransactionId();
TransactionId transactionId = newTransactionId(pTransactionId, spanChunkBo.getAgentId());
spanChunkBo.setTransactionId(transactionId);
} else {
logger.warn("PTransactionId is not set {}", pSpanChunk);
throw new IllegalStateException("PTransactionId is not set");
}
spanChunkBo.setKeyTime(pSpanChunk.getKeyTime());
spanChunkBo.setSpanId(pSpanChunk.getSpanId());
spanChunkBo.setEndPoint(pSpanChunk.getEndPoint());
return spanChunkBo;
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class SpanDecoderV0 method readSpan.
private SpanBo readSpan(Buffer qualifier, Buffer columnValue, SpanDecodingContext decodingContext) {
final SpanBo span = new SpanBo();
final TransactionId transactionId = decodingContext.getTransactionId();
span.setTransactionId(transactionId);
span.setCollectorAcceptTime(decodingContext.getCollectorAcceptedTime());
readQualifier(span, qualifier);
readSpanValue(columnValue, span, decodingContext);
return span;
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class SpanDecoderV0 method readSpanChunk.
private SpanChunkBo readSpanChunk(Buffer qualifier, Buffer columnValue, SpanDecodingContext decodingContext) {
final SpanChunkBo spanChunk = new SpanChunkBo();
final TransactionId transactionId = decodingContext.getTransactionId();
spanChunk.setTransactionId(transactionId);
spanChunk.setCollectorAcceptTime(decodingContext.getCollectorAcceptedTime());
readQualifier(spanChunk, qualifier);
readSpanChunkValue(columnValue, spanChunk, decodingContext);
return spanChunk;
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class DotSerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
TransactionId transactionId = TransactionIdUtils.parseTransactionId("aigw.dev.1^1395798795017^1527177");
Dot dot = new Dot(transactionId, 100, 99, 1, "agent");
String jsonValue = mapper.writeValueAsString(dot);
Assert.assertEquals("[100,99,\"aigw.dev.1^1395798795017^1527177\",0]", jsonValue);
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class ScatterDataTest method addDotTest3.
@Test
public void addDotTest3() {
long from = 1000;
long to = 10000;
int xGroupUnit = 100;
int yGroupUnit = 100;
ScatterDataBuilder builder = new ScatterDataBuilder(from, to, xGroupUnit, yGroupUnit);
long currentTime = System.currentTimeMillis();
TransactionId transactionId = new TransactionId(transactionAgentId, currentTime, 1);
long acceptedTime = Math.max(Math.abs(ThreadLocalRandom.current().nextLong(Long.MAX_VALUE)), from);
int executionTime = (int) Math.abs(ThreadLocalRandom.current().nextLong(60 * 1000));
long acceptedTime2 = Math.max(Math.abs(ThreadLocalRandom.current().nextLong(Long.MAX_VALUE)), from);
Dot dot1 = new Dot(transactionId, acceptedTime2, executionTime, 0, agentId);
Dot dot2 = new Dot(transactionId, acceptedTime2, executionTime, 0, agentId);
builder.addDot(dot1);
builder.addDot(dot2);
List<Dot> dots = extractDotList(builder.build());
Assert.assertEquals(2, dots.size());
}
Aggregations