Search in sources :

Example 1 with AggreJoinMemoryBo

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"));
}
Also used : AggreJoinMemoryBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinMemoryBo) JoinMemoryBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo) AggreJoinMemoryBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinMemoryBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) Test(org.junit.Test)

Example 2 with AggreJoinMemoryBo

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;
}
Also used : AggreJoinMemoryBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinMemoryBo) JoinMemoryBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo) AggreJoinMemoryBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinMemoryBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)

Example 3 with 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));
    }
}
Also used : ArrayList(java.util.ArrayList) Point(com.navercorp.pinpoint.web.vo.chart.Point) Range(com.navercorp.pinpoint.web.vo.Range) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) Point(com.navercorp.pinpoint.web.vo.chart.Point) StatChartGroup(com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup) AggreJoinMemoryBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinMemoryBo) Chart(com.navercorp.pinpoint.web.vo.chart.Chart) Test(org.junit.Test)

Aggregations

AggreJoinMemoryBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinMemoryBo)3 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)2 JoinMemoryBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinMemoryBo)2 Test (org.junit.Test)2 TimeWindow (com.navercorp.pinpoint.web.util.TimeWindow)1 Range (com.navercorp.pinpoint.web.vo.Range)1 Chart (com.navercorp.pinpoint.web.vo.chart.Chart)1 Point (com.navercorp.pinpoint.web.vo.chart.Point)1 StatChartGroup (com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup)1 ArrayList (java.util.ArrayList)1