use of com.navercorp.pinpoint.web.util.TimeWindow 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));
}
}
use of com.navercorp.pinpoint.web.util.TimeWindow 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));
}
}
use of com.navercorp.pinpoint.web.util.TimeWindow 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));
}
}
use of com.navercorp.pinpoint.web.util.TimeWindow 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);
}
use of com.navercorp.pinpoint.web.util.TimeWindow 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));
}
}
Aggregations