use of com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo in project pinpoint by naver.
the class JoinActiveTraceSampler method sampleDataPoints.
@Override
public AggreJoinActiveTraceBo sampleDataPoints(int index, long timestamp, List<JoinActiveTraceBo> joinActiveTraceBoList, JoinActiveTraceBo previousDataPoint) {
if (CollectionUtils.isEmpty(joinActiveTraceBoList)) {
return AggreJoinActiveTraceBo.createUncollectedObject(timestamp);
}
JoinActiveTraceBo joinActiveTraceBo = JoinActiveTraceBo.joinActiveTraceBoList(joinActiveTraceBoList, timestamp);
String id = joinActiveTraceBo.getId();
int histogramSchemaType = joinActiveTraceBo.getHistogramSchemaType();
short version = joinActiveTraceBo.getVersion();
JoinIntFieldBo totalCountValue = joinActiveTraceBo.getTotalCountJoinValue();
AggreJoinActiveTraceBo aggreJoinActiveTraceBo = new AggreJoinActiveTraceBo(id, histogramSchemaType, version, totalCountValue, timestamp);
return aggreJoinActiveTraceBo;
}
use of com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo in project pinpoint by naver.
the class JoinActiveTraceSamplerTest method sampleDataPointsTest.
@Test
public void sampleDataPointsTest() {
long currentTime = 1487149800000L;
JoinActiveTraceSampler sampler = new JoinActiveTraceSampler();
List<JoinActiveTraceBo> joinActiveTraceBoList = createJoinActiveTraceBoList(currentTime);
AggreJoinActiveTraceBo aggreJoinActiveTraceBo = sampler.sampleDataPoints(1, currentTime, joinActiveTraceBoList, JoinActiveTraceBo.EMPTY_JOIN_ACTIVE_TRACE_BO);
assertEquals(aggreJoinActiveTraceBo.getId(), "test_app");
assertEquals(aggreJoinActiveTraceBo.getHistogramSchemaType(), 1);
assertEquals(aggreJoinActiveTraceBo.getVersion(), 2);
assertEquals(aggreJoinActiveTraceBo.getTotalCountJoinValue(), new JoinIntFieldBo(130, 10, "app_1_1", 560, "app_4_2"));
assertEquals(aggreJoinActiveTraceBo.getTimestamp(), 1487149800000L);
}
use of com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo in project pinpoint by naver.
the class ApplicationActiveTraceChartGroupTest method createApplicationActiveTraceChartGroupTest.
@Test
public void createApplicationActiveTraceChartGroupTest() {
long time = 1495418083250L;
String id = "testApp";
Range range = Range.newRange(time - 240000, time);
TimeWindow timeWindow = new TimeWindow(range);
List<AggreJoinActiveTraceBo> aggreJoinActiveTraceBoList = new ArrayList<>(5);
AggreJoinActiveTraceBo aggreJoinActiveTraceBo1 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 150, 10, "app_1_1", 230, "app_1_2", time);
AggreJoinActiveTraceBo aggreJoinActiveTraceBo2 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 110, 22, "app_2_1", 330, "app_2_2", time - 60000);
AggreJoinActiveTraceBo aggreJoinActiveTraceBo3 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 120, 24, "app_3_1", 540, "app_3_2", time - 120000);
AggreJoinActiveTraceBo aggreJoinActiveTraceBo4 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 130, 25, "app_4_1", 560, "app_4_2", time - 180000);
AggreJoinActiveTraceBo aggreJoinActiveTraceBo5 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 140, 12, "app_5_1", 260, "app_5_2", time - 240000);
aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo1);
aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo2);
aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo3);
aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo4);
aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo5);
StatChartGroup applicationActiveTraceChartGroup = new ApplicationActiveTraceChart.ApplicationActiveTraceChartGroup(timeWindow, aggreJoinActiveTraceBoList);
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationActiveTraceChartGroup.getCharts();
Chart<? extends Point> activeTraceChart = charts.get(ApplicationActiveTraceChart.ApplicationActiveTraceChartGroup.ActiveTraceChartType.ACTIVE_TRACE_COUNT);
List<? extends Point> activeTracePointList = activeTraceChart.getPoints();
assertEquals(5, activeTracePointList.size());
int index = activeTracePointList.size();
for (Point point : activeTracePointList) {
testActiveTraceCount((IntApplicationStatPoint) point, aggreJoinActiveTraceBoList.get(--index));
}
}
Aggregations