use of com.navercorp.pinpoint.web.vo.stat.AggreJoinMemoryBo in project pinpoint by naver.
the class JoinMemorySamplerTest method sampleDataPointsTest.
@Test
public void sampleDataPointsTest() throws Exception {
long currentTime = 1487149800000L;
List<JoinMemoryBo> joinMemoryBoList = createJoinMemoryBoList(currentTime);
AggreJoinMemoryBo aggreJoinMemoryBo = new JoinMemorySampler().sampleDataPoints(1, currentTime, joinMemoryBoList, JoinMemoryBo.EMPTY_JOIN_MEMORY_BO);
assertEquals(aggreJoinMemoryBo.getId(), ID);
assertEquals(aggreJoinMemoryBo.getTimestamp(), currentTime);
assertEquals(aggreJoinMemoryBo.getHeapUsedJoinValue(), new JoinLongFieldBo(3000L, 100L, "app_4_1", 8000L, "app_3_2"));
assertEquals(aggreJoinMemoryBo.getNonHeapUsedJoinValue(), new JoinLongFieldBo(300L, 50L, "app_1_3", 2900L, "app_5_4"));
}
use of com.navercorp.pinpoint.web.vo.stat.AggreJoinMemoryBo in project pinpoint by naver.
the class JoinMemorySampler method sampleDataPoints.
@Override
public AggreJoinMemoryBo sampleDataPoints(int index, long timestamp, List<JoinMemoryBo> joinMemoryBoList, JoinMemoryBo previousDataPoint) {
if (CollectionUtils.isEmpty(joinMemoryBoList)) {
return AggreJoinMemoryBo.createUncollectedObject(timestamp);
}
JoinMemoryBo joinMemoryBo = JoinMemoryBo.joinMemoryBoList(joinMemoryBoList, timestamp);
String id = joinMemoryBo.getId();
final JoinLongFieldBo heapUsedJoinValue = joinMemoryBo.getHeapUsedJoinValue();
final JoinLongFieldBo nonHeapUsedJoinValue = joinMemoryBo.getNonHeapUsedJoinValue();
AggreJoinMemoryBo aggreJoinMemoryBo = new AggreJoinMemoryBo(id, timestamp, heapUsedJoinValue, nonHeapUsedJoinValue);
return aggreJoinMemoryBo;
}
use of com.navercorp.pinpoint.web.vo.stat.AggreJoinMemoryBo in project pinpoint by naver.
the class ApplicationMemoryChartGroupTest method createApplicationMemoryChartGroupTest.
@Test
public void createApplicationMemoryChartGroupTest() {
long time = 1495418083250L;
Range range = Range.newRange(time - 240000, time);
TimeWindow timeWindow = new TimeWindow(range);
List<AggreJoinMemoryBo> aggreJoinMemoryList = new ArrayList<>(5);
AggreJoinMemoryBo aggreJoinMemoryBo1 = new AggreJoinMemoryBo("testApp", time, 3000, 1000, 5000, "agent1_1", "agent1_2", 300, 100, 500, "agent1_3", "agent1_4");
AggreJoinMemoryBo aggreJoinMemoryBo2 = new AggreJoinMemoryBo("testApp", time - 60000, 2000, 1200, 5000, "agent2_1", "agent2_2", 200, 100, 600, "agent2_3", "agent2_4");
AggreJoinMemoryBo aggreJoinMemoryBo3 = new AggreJoinMemoryBo("testApp", time - 120000, 1000, 1300, 7000, "agent3_1", "agent3_2", 400, 200, 700, "agent3_3", "agent3_4");
AggreJoinMemoryBo aggreJoinMemoryBo4 = new AggreJoinMemoryBo("testApp", time - 180000, 5000, 1400, 8000, "agent4_1", "agent4_2", 500, 300, 800, "agent4_3", "agent4_4");
AggreJoinMemoryBo aggreJoinMemoryBo5 = new AggreJoinMemoryBo("testApp", time - 240000, 4000, 1500, 9000, "agent5_1", "agent5_2", 400, 400, 900, "agent5_3", "agent5_4");
aggreJoinMemoryList.add(aggreJoinMemoryBo1);
aggreJoinMemoryList.add(aggreJoinMemoryBo2);
aggreJoinMemoryList.add(aggreJoinMemoryBo3);
aggreJoinMemoryList.add(aggreJoinMemoryBo4);
aggreJoinMemoryList.add(aggreJoinMemoryBo5);
StatChartGroup applicationMemoryChartGroup = new ApplicationMemoryChart.ApplicationMemoryChartGroup(timeWindow, aggreJoinMemoryList);
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationMemoryChartGroup.getCharts();
Chart heapChart = charts.get(ApplicationMemoryChart.ApplicationMemoryChartGroup.MemoryChartType.MEMORY_HEAP);
List<Point> heapPoints = heapChart.getPoints();
assertEquals(5, heapPoints.size());
int index = heapPoints.size();
for (Point point : heapPoints) {
testHeap((DoubleApplicationStatPoint) point, aggreJoinMemoryList.get(--index));
}
Chart nonHeapChart = charts.get(ApplicationMemoryChart.ApplicationMemoryChartGroup.MemoryChartType.MEMORY_NON_HEAP);
List<Point> nonHeapPoints = heapChart.getPoints();
assertEquals(5, nonHeapPoints.size());
index = nonHeapPoints.size();
for (Point point : nonHeapPoints) {
testHeap((DoubleApplicationStatPoint) point, aggreJoinMemoryList.get(--index));
}
}
Aggregations