Search in sources :

Example 1 with AggreJoinTransactionBo

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

the class JoinTransactionSamplerTest method sampleDataPointsTest.

@Test
public void sampleDataPointsTest() {
    long currentTime = 1487149800000L;
    JoinTransactionSampler joinTransactionSampler = new JoinTransactionSampler();
    List<JoinTransactionBo> joinTransactionBoList = createJoinTransactionBoList(currentTime);
    AggreJoinTransactionBo aggreJoinTransactionBo = joinTransactionSampler.sampleDataPoints(1, currentTime, joinTransactionBoList, JoinTransactionBo.EMPTY_JOIN_TRANSACTION_BO);
    assertEquals(aggreJoinTransactionBo.getId(), "test_app");
    assertEquals(aggreJoinTransactionBo.getCollectInterval(), 5000);
    assertEquals(aggreJoinTransactionBo.getTotalCountJoinValue(), new JoinLongFieldBo(130l, 10l, "app_1_1", 560l, "app_4_2"));
    assertEquals(aggreJoinTransactionBo.getTimestamp(), 1487149800000L);
}
Also used : AggreJoinTransactionBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTransactionBo) JoinTransactionBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo) AggreJoinTransactionBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTransactionBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) Test(org.junit.Test)

Example 2 with AggreJoinTransactionBo

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

the class JoinTransactionSampler method sampleDataPoints.

@Override
public AggreJoinTransactionBo sampleDataPoints(int index, long timestamp, List<JoinTransactionBo> joinTransactionBoList, JoinTransactionBo previousDataPoint) {
    if (CollectionUtils.isEmpty(joinTransactionBoList)) {
        return AggreJoinTransactionBo.createUncollectedObject(timestamp);
    }
    JoinTransactionBo joinTransactionBo = JoinTransactionBo.joinTransactionBoList(joinTransactionBoList, timestamp);
    String id = joinTransactionBo.getId();
    long collectInterval = joinTransactionBo.getCollectInterval();
    final JoinLongFieldBo totalCountJoinValue = joinTransactionBo.getTotalCountJoinValue();
    AggreJoinTransactionBo aggreJoinTransactionBo = new AggreJoinTransactionBo(id, collectInterval, totalCountJoinValue, timestamp);
    return aggreJoinTransactionBo;
}
Also used : AggreJoinTransactionBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTransactionBo) JoinTransactionBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo) AggreJoinTransactionBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinTransactionBo) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)

Example 3 with AggreJoinTransactionBo

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

Aggregations

AggreJoinTransactionBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinTransactionBo)3 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)2 JoinTransactionBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo)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