use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.
the class ScatterDataTest method addDotTest2.
@Test
public void addDotTest2() throws Exception {
long from = 1000;
long to = 10000;
int xGroupUnit = 100;
int yGroupUnit = 100;
ScatterData scatterData = new ScatterData(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);
scatterData.addDot(dot1);
scatterData.addDot(dot2);
Map<Long, DotGroups> scatterDataMap = scatterData.getScatterDataMap();
Collection<DotGroups> values = scatterDataMap.values();
Assert.assertTrue(values.size() == 1);
for (DotGroups dotGroups : values) {
Map<Dot, DotGroup> dotGroupLeaders = dotGroups.getDotGroupLeaders();
Assert.assertTrue(dotGroupLeaders.keySet().size() == 2);
}
}
use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.
the class ScatterDataTest method addDotTest.
@Test
public void addDotTest() throws Exception {
int count = 100;
long from = 1000;
long to = 10000;
int xGroupUnit = 100;
int yGroupUnit = 100;
ScatterData scatterData = new ScatterData(from, to, xGroupUnit, yGroupUnit);
List<Dot> dotList = createDotList(agentId, transactionAgentId, count, from);
for (Dot dot : dotList) {
scatterData.addDot(dot);
}
List<Dot> dots = extractDotList(scatterData);
Assert.assertEquals(count, dots.size());
}
use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.
the class DotExtractor method getApplicationScatterData.
public Map<Application, ScatterData> getApplicationScatterData(long from, long to, int xGroupUnitMillis, int yGroupUnitMillis) {
Map<Application, ScatterData> applicationScatterDataMap = new HashMap<>();
for (Map.Entry<Application, List<Dot>> entry : this.dotMap.entrySet()) {
Application application = entry.getKey();
List<Dot> dotList = entry.getValue();
ScatterData scatterData = new ScatterData(from, to, xGroupUnitMillis, yGroupUnitMillis);
scatterData.addDot(dotList);
applicationScatterDataMap.put(application, scatterData);
}
return applicationScatterDataMap;
}
use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.
the class DotExtractor method getApplicationScatterScanResult.
public List<ApplicationScatterScanResult> getApplicationScatterScanResult() {
List<ApplicationScatterScanResult> applicationScatterScanResult = new ArrayList<>();
for (Map.Entry<Application, List<Dot>> entry : this.dotMap.entrySet()) {
List<Dot> dotList = entry.getValue();
Application application = entry.getKey();
ScatterScanResult scatterScanResult = new ScatterScanResult(range.getFrom(), range.getTo(), dotList);
applicationScatterScanResult.add(new ApplicationScatterScanResult(application, scatterScanResult));
}
return applicationScatterScanResult;
}
use of com.navercorp.pinpoint.web.vo.scatter.Dot in project pinpoint by naver.
the class DotExtractor method addDot.
public void addDot(SpanBo span) {
if (span == null) {
throw new NullPointerException("span must not be null");
}
Application spanApplication = this.applicationFactory.createApplication(span.getApplicationId(), span.getApplicationServiceType());
final List<Dot> dotList = getDotList(spanApplication);
final TransactionId transactionId = span.getTransactionId();
final Dot dot = new Dot(transactionId, span.getCollectorAcceptTime(), span.getElapsed(), span.getErrCode(), span.getAgentId());
dotList.add(dot);
logger.trace("Application:{} Dot:{}", spanApplication, dot);
}
Aggregations