use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class FilteringSpanDecoderTest method constructorFailureTest3.
@Test(expected = NullPointerException.class)
public void constructorFailureTest3() {
SpanDecoder mockSpanDecoder = Mockito.mock(SpanDecoder.class);
TransactionId transactionId = Random.createTransactionId();
GetTraceInfo getTraceInfo = new GetTraceInfo(transactionId);
SpanQueryBuilder builder = new SpanQueryBuilder();
SpanQuery query = builder.build(getTraceInfo);
new FilteringSpanDecoder(mockSpanDecoder, query.getSpanFilter());
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class ScatterDataTest method createDotList.
private List<Dot> createDotList(String agentId, String transactionAgentId, int createSize, long from) {
long currentTime = System.currentTimeMillis();
List<TransactionId> transactionIdList = new ArrayList<>(createSize);
for (int i = 0; i < createSize; i++) {
transactionIdList.add(new TransactionId(transactionAgentId, currentTime, i));
}
long acceptedTime = Math.max(Math.abs(ThreadLocalRandom.current().nextLong(Long.MAX_VALUE)), from);
int executionTime = (int) Math.abs(ThreadLocalRandom.current().nextLong(60 * 1000));
List<Dot> dotList = new ArrayList<>(createSize);
for (int i = 0; i < createSize; i++) {
int exceptionCode = ThreadLocalRandom.current().nextInt(0, 2);
dotList.add(new Dot(transactionIdList.get(i), Math.max(Math.abs(ThreadLocalRandom.current().nextLong(Long.MAX_VALUE)), from), executionTime, exceptionCode, agentId));
}
long seed = System.nanoTime();
Collections.shuffle(dotList, new Random(seed));
return dotList;
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class ScatterDataTest method addDotTest2.
@Test
public void addDotTest2() {
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 transactionId1 = new TransactionId(transactionAgentId, currentTime, 1);
TransactionId transactionId2 = new TransactionId(transactionAgentId, currentTime, 2);
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(transactionId1, acceptedTime2, executionTime, 0, agentId);
Dot dot2 = new Dot(transactionId2, acceptedTime2, executionTime, 1, agentId);
builder.addDot(dot1);
builder.addDot(dot2);
ScatterData scatterData = builder.build();
List<DotGroups> values = scatterData.getScatterData();
Assert.assertEquals(1, values.size());
for (DotGroups dotGroups : values) {
Map<Dot, DotGroup> dotGroupLeaders = dotGroups.getDotGroupLeaders();
Assert.assertEquals(2, dotGroupLeaders.keySet().size());
}
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class DotExtractor method newDot.
public Dot newDot(SpanBo span) {
Objects.requireNonNull(span, "span");
final TransactionId transactionId = span.getTransactionId();
return new Dot(transactionId, span.getCollectorAcceptTime(), span.getElapsed(), span.getErrCode(), span.getAgentId());
}
use of com.navercorp.pinpoint.common.profiler.util.TransactionId in project pinpoint by naver.
the class HeatMapServiceImpl method dotToGetTraceInfo.
private GetTraceInfo dotToGetTraceInfo(String applicationName, Dot dot) {
TransactionId transactionId = dot.getTransactionId();
SpanHint spanHint = new SpanHint(dot.getAcceptedTime(), dot.getElapsedTime(), applicationName);
return new GetTraceInfo(transactionId, spanHint);
}
Aggregations