Search in sources :

Example 11 with Point

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

the class DataSourceChartGroupTest method basicFunctionTest2.

@Test
public void basicFunctionTest2() {
    long currentTimeMillis = System.currentTimeMillis();
    TimeWindow timeWindow = new TimeWindow(Range.newRange(currentTimeMillis - 300000, currentTimeMillis));
    List<SampledDataSource> sampledDataSourceList = Collections.emptyList();
    DataSourceChart dataSourceChartGroup = new DataSourceChart(timeWindow, sampledDataSourceList, serviceTypeRegistryService);
    Assert.assertEquals(-1, dataSourceChartGroup.getId());
    Assert.assertEquals(null, dataSourceChartGroup.getJdbcUrl());
    Assert.assertEquals(null, dataSourceChartGroup.getDatabaseName());
    Assert.assertEquals(null, dataSourceChartGroup.getServiceType());
    Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = dataSourceChartGroup.getCharts().getCharts();
    Assert.assertEquals(2, charts.size());
    for (Chart<? extends Point> chart : charts.values()) {
        Assert.assertTrue(CollectionUtils.isEmpty(chart.getPoints()));
    }
}
Also used : SampledDataSource(com.navercorp.pinpoint.web.vo.stat.SampledDataSource) Point(com.navercorp.pinpoint.web.vo.chart.Point) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) Chart(com.navercorp.pinpoint.web.vo.chart.Chart) Test(org.junit.Test)

Example 12 with Point

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

the class ApplicationResponseTimeChartGroupTest method createApplicationResponseTimeChartGroupTest.

@Test
public void createApplicationResponseTimeChartGroupTest() {
    long time = 1495418083250L;
    Range range = Range.newRange(time - 240000, time);
    TimeWindow timeWindow = new TimeWindow(range);
    final String id = "test_app";
    List<AggreJoinResponseTimeBo> aggreJoinResponseTimeBoList = new ArrayList<AggreJoinResponseTimeBo>();
    AggreJoinResponseTimeBo aggreJoinResponseTimeBo1 = new AggreJoinResponseTimeBo(id, time, 3000, 2, "app_1_1", 6000, "app_1_1");
    AggreJoinResponseTimeBo aggreJoinResponseTimeBo2 = new AggreJoinResponseTimeBo(id, time - 60000, 4000, 200, "app_2_1", 9000, "app_2_1");
    AggreJoinResponseTimeBo aggreJoinResponseTimeBo3 = new AggreJoinResponseTimeBo(id, time - 120000, 2000, 20, "app_3_1", 7000, "app_3_1");
    AggreJoinResponseTimeBo aggreJoinResponseTimeBo4 = new AggreJoinResponseTimeBo(id, time - 180000, 5000, 20, "app_4_1", 8000, "app_4_1");
    AggreJoinResponseTimeBo aggreJoinResponseTimeBo5 = new AggreJoinResponseTimeBo(id, time - 240000, 1000, 10, "app_5_1", 6600, "app_5_1");
    aggreJoinResponseTimeBoList.add(aggreJoinResponseTimeBo1);
    aggreJoinResponseTimeBoList.add(aggreJoinResponseTimeBo2);
    aggreJoinResponseTimeBoList.add(aggreJoinResponseTimeBo3);
    aggreJoinResponseTimeBoList.add(aggreJoinResponseTimeBo4);
    aggreJoinResponseTimeBoList.add(aggreJoinResponseTimeBo5);
    StatChartGroup applicationResponseTimeChartGroup = new ApplicationResponseTimeChart.ApplicationResponseTimeChartGroup(timeWindow, aggreJoinResponseTimeBoList);
    Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationResponseTimeChartGroup.getCharts();
    Chart responseTimeChart = charts.get(ApplicationResponseTimeChart.ApplicationResponseTimeChartGroup.ResponseTimeChartType.RESPONSE_TIME);
    List<Point> responseTimePointList = responseTimeChart.getPoints();
    assertEquals(5, responseTimePointList.size());
    int index = responseTimePointList.size();
    for (Point point : responseTimePointList) {
        testResponseTimeCount((DoubleApplicationStatPoint) point, aggreJoinResponseTimeBoList.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) AggreJoinResponseTimeBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo) Chart(com.navercorp.pinpoint.web.vo.chart.Chart) Test(org.junit.Test)

Example 13 with Point

use of com.navercorp.pinpoint.web.vo.chart.Point 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 14 with Point

use of com.navercorp.pinpoint.web.vo.chart.Point 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 15 with Point

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

Aggregations

Chart (com.navercorp.pinpoint.web.vo.chart.Chart)17 Point (com.navercorp.pinpoint.web.vo.chart.Point)17 TimeWindow (com.navercorp.pinpoint.web.util.TimeWindow)12 Test (org.junit.Test)11 Range (com.navercorp.pinpoint.web.vo.Range)10 StatChartGroup (com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup)10 ArrayList (java.util.ArrayList)10 SampledDataSource (com.navercorp.pinpoint.web.vo.stat.SampledDataSource)4 VisibleForTesting (com.navercorp.pinpoint.common.annotations.VisibleForTesting)1 AggreJoinActiveTraceBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinActiveTraceBo)1 AggreJoinCpuLoadBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinCpuLoadBo)1 AggreJoinDataSourceBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinDataSourceBo)1 AggreJoinDirectBufferBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinDirectBufferBo)1 AggreJoinFileDescriptorBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinFileDescriptorBo)1 AggreJoinLoadedClassBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinLoadedClassBo)1 AggreJoinMemoryBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinMemoryBo)1 AggreJoinResponseTimeBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo)1 AggreJoinTotalThreadCountBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinTotalThreadCountBo)1 AggreJoinTransactionBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinTransactionBo)1 SampledDeadlock (com.navercorp.pinpoint.web.vo.stat.SampledDeadlock)1