Search in sources :

Example 16 with StatChartGroup

use of com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup 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));
    }
}
Also used : AggreJoinTransactionBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTransactionBo) 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) Chart(com.navercorp.pinpoint.web.vo.chart.Chart) Test(org.junit.Test)

Example 17 with StatChartGroup

use of com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup 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)

Example 18 with StatChartGroup

use of com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup in project pinpoint by naver.

the class DeadlockChartGroupTest method basicFunctionTest1.

@Test
public void basicFunctionTest1() throws Exception {
    long currentTimeMillis = System.currentTimeMillis();
    TimeWindow timeWindow = new TimeWindow(Range.newRange(currentTimeMillis - 300000, currentTimeMillis));
    List<SampledDeadlock> sampledDeadlockList = createSampledResponseTimeList(timeWindow);
    StatChartGroup deadlockChartGroup = new DeadlockChart.DeadlockChartGroup(timeWindow, sampledDeadlockList);
    assertEquals(sampledDeadlockList, deadlockChartGroup);
}
Also used : StatChartGroup(com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup) SampledDeadlock(com.navercorp.pinpoint.web.vo.stat.SampledDeadlock) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) Test(org.junit.Test)

Example 19 with StatChartGroup

use of com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup in project pinpoint by naver.

the class ApplicationDirectBufferChartGroupTest method createApplicationDirectBufferChartGroupTest.

@Test
public void createApplicationDirectBufferChartGroupTest() {
    long time = 1495418083250L;
    Range range = Range.newRange(time - 240000, time);
    TimeWindow timeWindow = new TimeWindow(range);
    List<AggreJoinDirectBufferBo> aggreDirectBufferList = new ArrayList<>(5);
    AggreJoinDirectBufferBo aggreJoinDirectBufferBo1 = new AggreJoinDirectBufferBo("testApp", 11, 60, "agent1_1", 20, "agent1_2", 11, 60, "agent1_1", 20, "agent1_2", 11, 60, "agent1_1", 20, "agent1_2", 11, 60, "agent1_1", 20, "agent1_2", time);
    AggreJoinDirectBufferBo aggreJoinDirectBufferBo2 = new AggreJoinDirectBufferBo("testApp", 22, 52, "agent2_1", 10, "agent2_2", 22, 52, "agent2_1", 10, "agent2_2", 22, 52, "agent2_1", 10, "agent2_2", 22, 52, "agent2_1", 10, "agent2_2", time - 60000);
    AggreJoinDirectBufferBo aggreJoinDirectBufferBo3 = new AggreJoinDirectBufferBo("testApp", 33, 39, "agent3_1", 9, "agent3_2", 33, 39, "agent3_1", 9, "agent3_2", 33, 39, "agent3_1", 9, "agent3_2", 33, 39, "agent3_1", 9, "agent3_2", time - 120000);
    AggreJoinDirectBufferBo aggreJoinDirectBufferBo4 = new AggreJoinDirectBufferBo("testApp", 44, 42, "agent4_1", 25, "agent4_2", 44, 42, "agent4_1", 25, "agent4_2", 44, 42, "agent4_1", 25, "agent4_2", 44, 42, "agent4_1", 25, "agent4_2", time - 180000);
    AggreJoinDirectBufferBo aggreJoinDirectBufferBo5 = new AggreJoinDirectBufferBo("testApp", 55, 55, "agent5_1", 54, "agent5_2", 55, 55, "agent5_1", 54, "agent5_2", 55, 55, "agent5_1", 54, "agent5_2", 55, 55, "agent5_1", 54, "agent5_2", time - 240000);
    aggreDirectBufferList.add(aggreJoinDirectBufferBo1);
    aggreDirectBufferList.add(aggreJoinDirectBufferBo2);
    aggreDirectBufferList.add(aggreJoinDirectBufferBo3);
    aggreDirectBufferList.add(aggreJoinDirectBufferBo4);
    aggreDirectBufferList.add(aggreJoinDirectBufferBo5);
    StatChartGroup applicationDirectBufferChartGroup = new ApplicationDirectBufferChart.ApplicationDirectBufferChartGroup(timeWindow, aggreDirectBufferList);
    Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationDirectBufferChartGroup.getCharts();
    assertEquals(4, charts.size());
    Chart directCountChart = charts.get(ApplicationDirectBufferChart.ApplicationDirectBufferChartGroup.DirectBufferChartType.DIRECT_COUNT);
    List<Point> directCountPoints = directCountChart.getPoints();
    assertEquals(5, directCountPoints.size());
    int index = directCountPoints.size();
    for (Point point : directCountPoints) {
        testDirectCount((LongApplicationStatPoint) point, aggreDirectBufferList.get(--index));
    }
    Chart directMemoryUsedChart = charts.get(ApplicationDirectBufferChart.ApplicationDirectBufferChartGroup.DirectBufferChartType.DIRECT_MEMORY_USED);
    List<Point> directMemoryUsedPoints = directMemoryUsedChart.getPoints();
    assertEquals(5, directMemoryUsedPoints.size());
    index = directMemoryUsedPoints.size();
    for (Point point : directMemoryUsedPoints) {
        testDirectMemoryUsed((LongApplicationStatPoint) point, aggreDirectBufferList.get(--index));
    }
    Chart mappedCountChart = charts.get(ApplicationDirectBufferChart.ApplicationDirectBufferChartGroup.DirectBufferChartType.MAPPED_COUNT);
    List<Point> mappeedCountPoints = mappedCountChart.getPoints();
    assertEquals(5, mappeedCountPoints.size());
    index = mappeedCountPoints.size();
    for (Point point : mappeedCountPoints) {
        testMappedCount((LongApplicationStatPoint) point, aggreDirectBufferList.get(--index));
    }
    Chart mappedMemoryUsedChart = charts.get(ApplicationDirectBufferChart.ApplicationDirectBufferChartGroup.DirectBufferChartType.MAPPED_MEMORY_USED);
    List<Point> mappedMemoryUsedPoints = mappedMemoryUsedChart.getPoints();
    assertEquals(5, mappedMemoryUsedPoints.size());
    index = mappedMemoryUsedPoints.size();
    for (Point point : mappedMemoryUsedPoints) {
        testMappedMemoryUsed((LongApplicationStatPoint) point, aggreDirectBufferList.get(--index));
    }
}
Also used : AggreJoinDirectBufferBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinDirectBufferBo) 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) Chart(com.navercorp.pinpoint.web.vo.chart.Chart) Test(org.junit.Test)

Example 20 with StatChartGroup

use of com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup in project pinpoint by naver.

the class ResponseTimeChartGroupTest method basicFunctionTest1.

@Test
public void basicFunctionTest1() throws Exception {
    long currentTimeMillis = System.currentTimeMillis();
    TimeWindow timeWindow = new TimeWindow(Range.newRange(currentTimeMillis - 300000, currentTimeMillis));
    List<SampledResponseTime> sampledResponseTimeList = createSampledResponseTimeList(timeWindow);
    StatChartGroup responseTimeChartGroup = new ResponseTimeChart.ResponseTimeChartGroup(timeWindow, sampledResponseTimeList);
    assertEquals(sampledResponseTimeList, responseTimeChartGroup);
}
Also used : StatChartGroup(com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup) SampledResponseTime(com.navercorp.pinpoint.web.vo.stat.SampledResponseTime) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) Test(org.junit.Test)

Aggregations

TimeWindow (com.navercorp.pinpoint.web.util.TimeWindow)26 StatChartGroup (com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup)26 Test (org.junit.Test)26 Range (com.navercorp.pinpoint.web.vo.Range)20 Chart (com.navercorp.pinpoint.web.vo.chart.Chart)20 Point (com.navercorp.pinpoint.web.vo.chart.Point)20 ArrayList (java.util.ArrayList)20 AggreJoinActiveTraceBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo)2 AggreJoinCpuLoadBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinCpuLoadBo)2 AggreJoinDataSourceBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinDataSourceBo)2 AggreJoinDirectBufferBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinDirectBufferBo)2 AggreJoinFileDescriptorBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinFileDescriptorBo)2 AggreJoinLoadedClassBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinLoadedClassBo)2 AggreJoinMemoryBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinMemoryBo)2 AggreJoinResponseTimeBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo)2 AggreJoinTotalThreadCountBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinTotalThreadCountBo)2 AggreJoinTransactionBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinTransactionBo)2 SampledDataSource (com.navercorp.pinpoint.web.vo.stat.SampledDataSource)2 SampledDeadlock (com.navercorp.pinpoint.web.vo.stat.SampledDeadlock)2 SampledResponseTime (com.navercorp.pinpoint.web.vo.stat.SampledResponseTime)2