use of com.navercorp.pinpoint.web.scatter.ScatterDataBuilder 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();
ScatterDataBuilder scatterData = new ScatterDataBuilder(from, to, xGroupUnitMillis, yGroupUnitMillis);
scatterData.addDot(dotList);
applicationScatterDataMap.put(application, scatterData.build());
}
return applicationScatterDataMap;
}
use of com.navercorp.pinpoint.web.scatter.ScatterDataBuilder in project pinpoint by naver.
the class ScatterChartServiceImpl method selectScatterData.
@Override
public ScatterData selectScatterData(String applicationName, Range range, int xGroupUnit, int yGroupUnit, int limit, boolean backwardDirection) {
Objects.requireNonNull(applicationName, "applicationName");
Objects.requireNonNull(range, "range");
LimitedScanResult<List<Dot>> scanResult = applicationTraceIndexDao.scanTraceScatterData(applicationName, range, limit, backwardDirection);
ScatterDataBuilder builder = new ScatterDataBuilder(range.getFrom(), range.getTo(), xGroupUnit, yGroupUnit);
builder.addDot(scanResult.getScanData());
return builder.build();
}
use of com.navercorp.pinpoint.web.scatter.ScatterDataBuilder in project pinpoint by naver.
the class ScatterChartServiceImpl method selectScatterData.
@Override
public ScatterData selectScatterData(List<TransactionId> transactionIdList, String applicationName, Range range, int xGroupUnit, int yGroupUnit, Filter<List<SpanBo>> filter) {
Objects.requireNonNull(transactionIdList, "transactionIdList");
Objects.requireNonNull(applicationName, "applicationName");
Objects.requireNonNull(filter, "filter");
final List<List<SpanBo>> traceList = traceDao.selectAllSpans(transactionIdList);
populateAgentNameListOfList(traceList);
ScatterDataBuilder scatterData = new ScatterDataBuilder(range.getFrom(), range.getTo(), xGroupUnit, yGroupUnit);
for (List<SpanBo> trace : traceList) {
if (!filter.include(trace)) {
continue;
}
for (SpanBo span : trace) {
if (applicationName.equals(span.getApplicationId())) {
final TransactionId transactionId = span.getTransactionId();
final Dot dot = new Dot(transactionId, span.getCollectorAcceptTime(), span.getElapsed(), span.getErrCode(), span.getAgentId());
scatterData.addDot(dot);
}
}
}
return scatterData.build();
}
use of com.navercorp.pinpoint.web.scatter.ScatterDataBuilder in project pinpoint by naver.
the class HbaseApplicationTraceIndexDaoTest method scanTraceScatterDataTest.
@Test
public void scanTraceScatterDataTest() {
List<List<Dot>> scatterDotList = createScatterDotList();
when(this.hbaseOperations2.findParallel(any(TableName.class), any(Scan.class), any(AbstractRowKeyDistributor.class), anyInt(), any(RowMapper.class), anyInt())).thenReturn(scatterDotList);
Range range = Range.newRange(1000L, 5000L);
LimitedScanResult<List<Dot>> scanResult = this.applicationTraceIndexDao.scanTraceScatterData("app", range, 10, false);
ScatterDataBuilder builder = new ScatterDataBuilder(range.getFrom(), range.getTo(), 1, 5);
scanResult.getScanData().forEach(builder::addDot);
ScatterData result = builder.build();
Assert.assertEquals(1000L, result.getFrom());
Assert.assertEquals(5000L, result.getTo());
Assert.assertEquals(2000L, result.getOldestAcceptedTime());
Assert.assertEquals(3000L, result.getLatestAcceptedTime());
}
use of com.navercorp.pinpoint.web.scatter.ScatterDataBuilder in project pinpoint by naver.
the class HbaseApplicationTraceIndexDaoTest method scanTraceScatterDataEmptyTest.
@Test
public void scanTraceScatterDataEmptyTest() {
List<ScatterData> scannedList = new ArrayList<>();
when(this.hbaseOperations2.findParallel(any(TableName.class), any(Scan.class), any(AbstractRowKeyDistributor.class), anyInt(), any(RowMapper.class), any(LimitEventHandler.class), anyInt())).thenReturn(scannedList);
Range range = Range.newRange(1000L, 5000L);
LimitedScanResult<List<Dot>> scanResult = this.applicationTraceIndexDao.scanTraceScatterData("app", range, 10, false);
ScatterDataBuilder builder = new ScatterDataBuilder(range.getFrom(), range.getTo(), 1, 5);
scanResult.getScanData().forEach(builder::addDot);
ScatterData result = builder.build();
Assert.assertEquals(1000L, result.getFrom());
Assert.assertEquals(5000L, result.getTo());
Assert.assertEquals(0, result.getScatterData().size());
}
Aggregations