use of com.navercorp.pinpoint.web.vo.stat.AggreJoinLoadedClassBo in project pinpoint by naver.
the class JoinLoadedClassSamplerTest method sampleDataPoints.
@Test
public void sampleDataPoints() {
JoinLoadedClassSampler joinLoadedClassSampler = new JoinLoadedClassSampler();
List<JoinLoadedClassBo> joinLoadedClassBoList = new ArrayList<>(5);
long timeStamp = new Date().getTime();
joinLoadedClassBoList.add(new JoinLoadedClassBo("testApp", 11, 60, "agent1_1", 20, "agent1_2", 11, 60, "agent1_1", 20, "agent1_2", timeStamp + 5000));
joinLoadedClassBoList.add(new JoinLoadedClassBo("testApp", 22, 52, "agent2_1", 10, "agent2_2", 22, 52, "agent2_1", 10, "agent2_2", timeStamp + 10000));
joinLoadedClassBoList.add(new JoinLoadedClassBo("testApp", 33, 39, "agent3_1", 90, "agent3_2", 33, 39, "agent3_1", 90, "agent3_2", timeStamp + 15000));
joinLoadedClassBoList.add(new JoinLoadedClassBo("testApp", 44, 42, "agent4_1", 25, "agent4_2", 44, 42, "agent4_1", 25, "agent4_2", timeStamp + 20000));
joinLoadedClassBoList.add(new JoinLoadedClassBo("testApp", 55, 55, "agent5_1", 54, "agent5_2", 55, 55, "agent5_1", 54, "agent5_2", timeStamp + 25000));
AggreJoinLoadedClassBo aggreJoinLoadedClassBo = joinLoadedClassSampler.sampleDataPoints(0, new Date().getTime(), joinLoadedClassBoList, new JoinLoadedClassBo());
assertEquals(aggreJoinLoadedClassBo.getId(), "testApp");
assertEquals(aggreJoinLoadedClassBo.getLoadedClassJoinValue(), new JoinLongFieldBo(33L, 10L, "agent2_2", 60L, "agent1_1"));
assertEquals(aggreJoinLoadedClassBo.getUnloadedClassJoinValue(), new JoinLongFieldBo(33L, 10L, "agent2_2", 60L, "agent1_1"));
}
use of com.navercorp.pinpoint.web.vo.stat.AggreJoinLoadedClassBo in project pinpoint by naver.
the class ApplicationLoadedClassChartGroupTest method createApplicationLoadedClassChartGroupTest.
@Test
public void createApplicationLoadedClassChartGroupTest() {
long time = 1495418083250L;
Range range = Range.newRange(time - 240000, time);
TimeWindow timeWindow = new TimeWindow(range);
List<AggreJoinLoadedClassBo> aggreJoinLoadedClassBoList = new ArrayList<>(5);
AggreJoinLoadedClassBo aggreJoinLoadedClassBo1 = new AggreJoinLoadedClassBo("testApp", 11, 20, "agent1_1", 60, "agent1_2", 11, 20, "agent1_1", 60, "agent1_2", time);
AggreJoinLoadedClassBo aggreJoinLoadedClassBo2 = new AggreJoinLoadedClassBo("testApp", 22, 10, "agent2_1", 52, "agent2_2", 22, 10, "agent2_1", 52, "agent2_2", time - 60000);
AggreJoinLoadedClassBo aggreJoinLoadedClassBo3 = new AggreJoinLoadedClassBo("testApp", 33, 9, "agent3_1", 39, "agent3_2", 33, 9, "agent3_1", 39, "agent3_2", time - 120000);
AggreJoinLoadedClassBo aggreJoinLoadedClassBo4 = new AggreJoinLoadedClassBo("testApp", 44, 25, "agent4_1", 42, "agent4_2", 44, 25, "agent4_1", 42, "agent4_2", time - 180000);
AggreJoinLoadedClassBo aggreJoinLoadedClassBo5 = new AggreJoinLoadedClassBo("testApp", 55, 54, "agent5_1", 55, "agent5_2", 55, 54, "agent5_1", 55, "agent5_2", time - 240000);
aggreJoinLoadedClassBoList.add(aggreJoinLoadedClassBo1);
aggreJoinLoadedClassBoList.add(aggreJoinLoadedClassBo2);
aggreJoinLoadedClassBoList.add(aggreJoinLoadedClassBo3);
aggreJoinLoadedClassBoList.add(aggreJoinLoadedClassBo4);
aggreJoinLoadedClassBoList.add(aggreJoinLoadedClassBo5);
StatChartGroup applicationLoadedCLassChartGroup = new ApplicationLoadedClassChart.ApplicationLoadedClassChartGroup(timeWindow, aggreJoinLoadedClassBoList);
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationLoadedCLassChartGroup.getCharts();
assertEquals(2, charts.size());
Chart loadedClassChart = charts.get(ApplicationLoadedClassChart.ApplicationLoadedClassChartGroup.LoadedClassChartType.LOADED_CLASS_COUNT);
List<Point> loadedClassChartPoints = loadedClassChart.getPoints();
assertEquals(5, loadedClassChartPoints.size());
int index = loadedClassChartPoints.size();
for (Point point : loadedClassChartPoints) {
testLoadedCLass((LongApplicationStatPoint) point, aggreJoinLoadedClassBoList.get(--index));
}
Chart unloadedClassChart = charts.get(ApplicationLoadedClassChart.ApplicationLoadedClassChartGroup.LoadedClassChartType.UNLOADED_CLASS_COUNT);
List<Point> unloadedClassChartPoints = unloadedClassChart.getPoints();
assertEquals(5, unloadedClassChartPoints.size());
index = unloadedClassChartPoints.size();
for (Point point : unloadedClassChartPoints) {
testUnloadedCLass((LongApplicationStatPoint) point, aggreJoinLoadedClassBoList.get(--index));
}
}
use of com.navercorp.pinpoint.web.vo.stat.AggreJoinLoadedClassBo in project pinpoint by naver.
the class JoinLoadedClassSampler method sampleDataPoints.
@Override
public AggreJoinLoadedClassBo sampleDataPoints(int timeWindowIndex, long timestamp, List<JoinLoadedClassBo> joinLoadedClassBoList, JoinLoadedClassBo previousDataPoint) {
if (CollectionUtils.isEmpty(joinLoadedClassBoList)) {
return AggreJoinLoadedClassBo.createUncollectedObject(timestamp);
}
JoinLoadedClassBo joinLoadedClassBo = AggreJoinLoadedClassBo.joinLoadedClassBoList(joinLoadedClassBoList, timestamp);
String id = joinLoadedClassBo.getId();
JoinLongFieldBo loadedClassJoinValue = joinLoadedClassBo.getLoadedClassJoinValue();
JoinLongFieldBo unloadedClassJoinValue = joinLoadedClassBo.getUnloadedClassJoinValue();
AggreJoinLoadedClassBo aggreJoinLoadedClassBo = new AggreJoinLoadedClassBo(id, loadedClassJoinValue, unloadedClassJoinValue, timestamp);
return aggreJoinLoadedClassBo;
}
Aggregations