use of com.navercorp.pinpoint.web.vo.stat.AggreJoinTransactionBo in project pinpoint by naver.
the class JoinTransactionSamplerTest method sampleDataPointsTest.
@Test
public void sampleDataPointsTest() {
long currentTime = 1487149800000L;
JoinTransactionSampler joinTransactionSampler = new JoinTransactionSampler();
List<JoinTransactionBo> joinTransactionBoList = createJoinTransactionBoList(currentTime);
AggreJoinTransactionBo aggreJoinTransactionBo = joinTransactionSampler.sampleDataPoints(1, currentTime, joinTransactionBoList, JoinTransactionBo.EMPTY_JOIN_TRANSACTION_BO);
assertEquals(aggreJoinTransactionBo.getId(), "test_app");
assertEquals(aggreJoinTransactionBo.getCollectInterval(), 5000);
assertEquals(aggreJoinTransactionBo.getTotalCountJoinValue(), new JoinLongFieldBo(130l, 10l, "app_1_1", 560l, "app_4_2"));
assertEquals(aggreJoinTransactionBo.getTimestamp(), 1487149800000L);
}
use of com.navercorp.pinpoint.web.vo.stat.AggreJoinTransactionBo in project pinpoint by naver.
the class JoinTransactionSampler method sampleDataPoints.
@Override
public AggreJoinTransactionBo sampleDataPoints(int index, long timestamp, List<JoinTransactionBo> joinTransactionBoList, JoinTransactionBo previousDataPoint) {
if (CollectionUtils.isEmpty(joinTransactionBoList)) {
return AggreJoinTransactionBo.createUncollectedObject(timestamp);
}
JoinTransactionBo joinTransactionBo = JoinTransactionBo.joinTransactionBoList(joinTransactionBoList, timestamp);
String id = joinTransactionBo.getId();
long collectInterval = joinTransactionBo.getCollectInterval();
final JoinLongFieldBo totalCountJoinValue = joinTransactionBo.getTotalCountJoinValue();
AggreJoinTransactionBo aggreJoinTransactionBo = new AggreJoinTransactionBo(id, collectInterval, totalCountJoinValue, timestamp);
return aggreJoinTransactionBo;
}
use of com.navercorp.pinpoint.web.vo.stat.AggreJoinTransactionBo in project pinpoint by naver.
the class ApplicationTransactionChartGroupTest method createApplicationTransactionChartGroupTest.
@Test
public void createApplicationTransactionChartGroupTest() {
long time = 1495418083250L;
Range range = Range.newRange(time - 240000, time);
TimeWindow timeWindow = new TimeWindow(range);
final String id = "test_app";
List<AggreJoinTransactionBo> aggreJoinTransactionBoList = new ArrayList<AggreJoinTransactionBo>(5);
AggreJoinTransactionBo aggreJoinTransactionBo1 = new AggreJoinTransactionBo(id, 5000, 150, 10, "app_1_1", 230, "app_1_2", time);
AggreJoinTransactionBo aggreJoinTransactionBo2 = new AggreJoinTransactionBo(id, 5000, 110, 22, "app_2_1", 330, "app_2_2", time - 60000);
AggreJoinTransactionBo aggreJoinTransactionBo3 = new AggreJoinTransactionBo(id, 5000, 120, 24, "app_3_1", 540, "app_3_2", time - 120000);
AggreJoinTransactionBo aggreJoinTransactionBo4 = new AggreJoinTransactionBo(id, 5000, 130, 25, "app_4_1", 560, "app_4_2", time - 180000);
AggreJoinTransactionBo aggreJoinTransactionBo5 = new AggreJoinTransactionBo(id, 5000, 140, 12, "app_5_1", 260, "app_5_2", time - 240000);
aggreJoinTransactionBoList.add(aggreJoinTransactionBo1);
aggreJoinTransactionBoList.add(aggreJoinTransactionBo2);
aggreJoinTransactionBoList.add(aggreJoinTransactionBo3);
aggreJoinTransactionBoList.add(aggreJoinTransactionBo4);
aggreJoinTransactionBoList.add(aggreJoinTransactionBo5);
StatChartGroup applicationTransactionChartGroup = new ApplicationTransactionChart.ApplicationTransactionChartGroup(timeWindow, aggreJoinTransactionBoList);
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationTransactionChartGroup.getCharts();
Chart tranCountChart = charts.get(ApplicationTransactionChart.ApplicationTransactionChartGroup.TransactionChartType.TRANSACTION_COUNT);
List<Point> tranCountPointList = tranCountChart.getPoints();
assertEquals(5, tranCountPointList.size());
int index = tranCountPointList.size();
for (Point point : tranCountPointList) {
testTranCount((DoubleApplicationStatPoint) point, aggreJoinTransactionBoList.get(--index));
}
}
Aggregations