use of com.navercorp.pinpoint.web.util.TimeWindow in project pinpoint by naver.
the class ApplicationTotalThreadCountChartGroupTest method createApplicationTotalThreadCountChartGroupTest.
@Test
public void createApplicationTotalThreadCountChartGroupTest() {
long time = 1495418083250L;
Range range = Range.newRange(time - 240000, time);
TimeWindow timeWindow = new TimeWindow(range);
List<AggreJoinTotalThreadCountBo> aggreJoinTotalThreadCountBoList = new ArrayList<>(5);
AggreJoinTotalThreadCountBo aggreJoinFileDescriptorBo1 = new AggreJoinTotalThreadCountBo("testApp", time, 11, 20, "agent1_1", 60, "agent1_2");
AggreJoinTotalThreadCountBo aggreJoinFileDescriptorBo2 = new AggreJoinTotalThreadCountBo("testApp", time - 60000, 22, 10, "agent2_1", 52, "agent2_2");
AggreJoinTotalThreadCountBo aggreJoinFileDescriptorBo3 = new AggreJoinTotalThreadCountBo("testApp", time - 120000, 33, 9, "agent3_1", 39, "agent3_2");
AggreJoinTotalThreadCountBo aggreJoinFileDescriptorBo4 = new AggreJoinTotalThreadCountBo("testApp", time - 180000, 44, 25, "agent4_1", 42, "agent4_2");
AggreJoinTotalThreadCountBo aggreJoinFileDescriptorBo5 = new AggreJoinTotalThreadCountBo("testApp", time - 240000, 55, 54, "agent5_1", 55, "agent5_2");
aggreJoinTotalThreadCountBoList.add(aggreJoinFileDescriptorBo1);
aggreJoinTotalThreadCountBoList.add(aggreJoinFileDescriptorBo2);
aggreJoinTotalThreadCountBoList.add(aggreJoinFileDescriptorBo3);
aggreJoinTotalThreadCountBoList.add(aggreJoinFileDescriptorBo4);
aggreJoinTotalThreadCountBoList.add(aggreJoinFileDescriptorBo5);
StatChartGroup applicationTotalThreadCountChartGroup = new ApplicationTotalThreadCountChart.ApplicationTotalThreadCountChartGroup(timeWindow, aggreJoinTotalThreadCountBoList);
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationTotalThreadCountChartGroup.getCharts();
assertEquals(1, charts.size());
Chart totalThreadCountChart = charts.get(ApplicationTotalThreadCountChart.ApplicationTotalThreadCountChartGroup.TotalThreadCountChartType.TOTAL_THREAD_COUNT);
List<Point> totalThreadCountChartPoints = totalThreadCountChart.getPoints();
assertEquals(5, totalThreadCountChartPoints.size());
int index = totalThreadCountChartPoints.size();
for (Point point : totalThreadCountChartPoints) {
testTotalThreadCount((LongApplicationStatPoint) point, aggreJoinTotalThreadCountBoList.get(--index));
}
}
use of com.navercorp.pinpoint.web.util.TimeWindow in project pinpoint by naver.
the class DataSourceChartSerializerTest method serializeTest.
@Test
public void serializeTest() throws Exception {
long currentTimeMillis = System.currentTimeMillis();
TimeWindow timeWindow = new TimeWindow(Range.newRange(currentTimeMillis - 300000, currentTimeMillis));
List<SampledDataSource> sampledDataSourceList = createSampledDataSourceList(timeWindow);
DataSourceChart dataSourceChartGroup = new DataSourceChart(timeWindow, sampledDataSourceList, serviceTypeRegistryService);
String jsonValue = mapper.writeValueAsString(dataSourceChartGroup);
Map<?, ?> map = mapper.readValue(jsonValue, Map.class);
Assert.assertTrue(map.containsKey("id"));
Assert.assertTrue(map.containsKey("jdbcUrl"));
Assert.assertTrue(map.containsKey("databaseName"));
Assert.assertTrue(map.containsKey("serviceType"));
Assert.assertTrue(map.containsKey("charts"));
}
use of com.navercorp.pinpoint.web.util.TimeWindow in project pinpoint by naver.
the class ApplicationLoadedClassChartGroupTest method createApplicationLoadedClassChartGroupTest.
@Test
public void createApplicationLoadedClassChartGroupTest() {
long time = 1495418083250L;
Range range = Range.newRange(time - 240000, time);
TimeWindow timeWindow = new TimeWindow(range);
List<AggreJoinLoadedClassBo> aggreJoinLoadedClassBoList = new ArrayList<>(5);
AggreJoinLoadedClassBo aggreJoinLoadedClassBo1 = new AggreJoinLoadedClassBo("testApp", 11, 20, "agent1_1", 60, "agent1_2", 11, 20, "agent1_1", 60, "agent1_2", time);
AggreJoinLoadedClassBo aggreJoinLoadedClassBo2 = new AggreJoinLoadedClassBo("testApp", 22, 10, "agent2_1", 52, "agent2_2", 22, 10, "agent2_1", 52, "agent2_2", time - 60000);
AggreJoinLoadedClassBo aggreJoinLoadedClassBo3 = new AggreJoinLoadedClassBo("testApp", 33, 9, "agent3_1", 39, "agent3_2", 33, 9, "agent3_1", 39, "agent3_2", time - 120000);
AggreJoinLoadedClassBo aggreJoinLoadedClassBo4 = new AggreJoinLoadedClassBo("testApp", 44, 25, "agent4_1", 42, "agent4_2", 44, 25, "agent4_1", 42, "agent4_2", time - 180000);
AggreJoinLoadedClassBo aggreJoinLoadedClassBo5 = new AggreJoinLoadedClassBo("testApp", 55, 54, "agent5_1", 55, "agent5_2", 55, 54, "agent5_1", 55, "agent5_2", time - 240000);
aggreJoinLoadedClassBoList.add(aggreJoinLoadedClassBo1);
aggreJoinLoadedClassBoList.add(aggreJoinLoadedClassBo2);
aggreJoinLoadedClassBoList.add(aggreJoinLoadedClassBo3);
aggreJoinLoadedClassBoList.add(aggreJoinLoadedClassBo4);
aggreJoinLoadedClassBoList.add(aggreJoinLoadedClassBo5);
StatChartGroup applicationLoadedCLassChartGroup = new ApplicationLoadedClassChart.ApplicationLoadedClassChartGroup(timeWindow, aggreJoinLoadedClassBoList);
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationLoadedCLassChartGroup.getCharts();
assertEquals(2, charts.size());
Chart loadedClassChart = charts.get(ApplicationLoadedClassChart.ApplicationLoadedClassChartGroup.LoadedClassChartType.LOADED_CLASS_COUNT);
List<Point> loadedClassChartPoints = loadedClassChart.getPoints();
assertEquals(5, loadedClassChartPoints.size());
int index = loadedClassChartPoints.size();
for (Point point : loadedClassChartPoints) {
testLoadedCLass((LongApplicationStatPoint) point, aggreJoinLoadedClassBoList.get(--index));
}
Chart unloadedClassChart = charts.get(ApplicationLoadedClassChart.ApplicationLoadedClassChartGroup.LoadedClassChartType.UNLOADED_CLASS_COUNT);
List<Point> unloadedClassChartPoints = unloadedClassChart.getPoints();
assertEquals(5, unloadedClassChartPoints.size());
index = unloadedClassChartPoints.size();
for (Point point : unloadedClassChartPoints) {
testUnloadedCLass((LongApplicationStatPoint) point, aggreJoinLoadedClassBoList.get(--index));
}
}
use of com.navercorp.pinpoint.web.util.TimeWindow in project pinpoint by naver.
the class ApplicationActiveTraceChartGroupTest method createApplicationActiveTraceChartGroupTest.
@Test
public void createApplicationActiveTraceChartGroupTest() {
long time = 1495418083250L;
String id = "testApp";
Range range = Range.newRange(time - 240000, time);
TimeWindow timeWindow = new TimeWindow(range);
List<AggreJoinActiveTraceBo> aggreJoinActiveTraceBoList = new ArrayList<>(5);
AggreJoinActiveTraceBo aggreJoinActiveTraceBo1 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 150, 10, "app_1_1", 230, "app_1_2", time);
AggreJoinActiveTraceBo aggreJoinActiveTraceBo2 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 110, 22, "app_2_1", 330, "app_2_2", time - 60000);
AggreJoinActiveTraceBo aggreJoinActiveTraceBo3 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 120, 24, "app_3_1", 540, "app_3_2", time - 120000);
AggreJoinActiveTraceBo aggreJoinActiveTraceBo4 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 130, 25, "app_4_1", 560, "app_4_2", time - 180000);
AggreJoinActiveTraceBo aggreJoinActiveTraceBo5 = new AggreJoinActiveTraceBo(id, 1, (short) 2, 140, 12, "app_5_1", 260, "app_5_2", time - 240000);
aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo1);
aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo2);
aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo3);
aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo4);
aggreJoinActiveTraceBoList.add(aggreJoinActiveTraceBo5);
StatChartGroup applicationActiveTraceChartGroup = new ApplicationActiveTraceChart.ApplicationActiveTraceChartGroup(timeWindow, aggreJoinActiveTraceBoList);
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationActiveTraceChartGroup.getCharts();
Chart<? extends Point> activeTraceChart = charts.get(ApplicationActiveTraceChart.ApplicationActiveTraceChartGroup.ActiveTraceChartType.ACTIVE_TRACE_COUNT);
List<? extends Point> activeTracePointList = activeTraceChart.getPoints();
assertEquals(5, activeTracePointList.size());
int index = activeTracePointList.size();
for (Point point : activeTracePointList) {
testActiveTraceCount((IntApplicationStatPoint) point, aggreJoinActiveTraceBoList.get(--index));
}
}
use of com.navercorp.pinpoint.web.util.TimeWindow in project pinpoint by naver.
the class ApplicationCpuLoadChartGroupTest method createApplicationCpuLoadChartGroupTest.
@Test
public void createApplicationCpuLoadChartGroupTest() {
long time = 1495418083250L;
Range range = Range.newRange(time - 240000, time);
TimeWindow timeWindow = new TimeWindow(range);
List<AggreJoinCpuLoadBo> aggreCpuLoadList = new ArrayList<>(5);
AggreJoinCpuLoadBo aggreJoinCpuLoadBo1 = new AggreJoinCpuLoadBo("testApp", 0.11, 0.60, "agent1_1", 0.20, "agent1_2", 0.1, 0.60, "agent1_3", 0.47, "agent1_4", time);
AggreJoinCpuLoadBo aggreJoinCpuLoadBo2 = new AggreJoinCpuLoadBo("testApp", 0.22, 0.52, "agent2_1", 0.10, "agent2_2", 0.2, 0.70, "agent2_3", 0.24, "agent2_4", time - 60000);
AggreJoinCpuLoadBo aggreJoinCpuLoadBo3 = new AggreJoinCpuLoadBo("testApp", 0.33, 0.39, "agent3_1", 0.9, "agent3_2", 0.3, 0.85, "agent3_3", 0.33, "agent3_4", time - 120000);
AggreJoinCpuLoadBo aggreJoinCpuLoadBo4 = new AggreJoinCpuLoadBo("testApp", 0.44, 0.42, "agent4_1", 0.25, "agent4_2", 0.4, 0.58, "agent4_3", 0.56, "agent4_4", time - 180000);
AggreJoinCpuLoadBo aggreJoinCpuLoadBo5 = new AggreJoinCpuLoadBo("testApp", 0.55, 0.55, "agent5_1", 0.54, "agent5_2", 0.5, 0.86, "agent5_3", 0.76, "agent5_4", time - 240000);
aggreCpuLoadList.add(aggreJoinCpuLoadBo1);
aggreCpuLoadList.add(aggreJoinCpuLoadBo2);
aggreCpuLoadList.add(aggreJoinCpuLoadBo3);
aggreCpuLoadList.add(aggreJoinCpuLoadBo4);
aggreCpuLoadList.add(aggreJoinCpuLoadBo5);
StatChartGroup applicationCpuLoadChartGroup = new ApplicationCpuLoadChart.ApplicationCpuLoadChartGroup(timeWindow, aggreCpuLoadList);
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationCpuLoadChartGroup.getCharts();
assertEquals(2, charts.size());
Chart jvmCpuLodChart = charts.get(ApplicationCpuLoadChart.ApplicationCpuLoadChartGroup.CpuLoadChartType.CPU_LOAD_JVM);
List<Point> jvmCpuLoadPoints = jvmCpuLodChart.getPoints();
assertEquals(5, jvmCpuLoadPoints.size());
int index = jvmCpuLoadPoints.size();
for (Point point : jvmCpuLoadPoints) {
testJvmCpuLoad((DoubleApplicationStatPoint) point, aggreCpuLoadList.get(--index));
}
Chart sysCpuLoadChart = charts.get(ApplicationCpuLoadChart.ApplicationCpuLoadChartGroup.CpuLoadChartType.CPU_LOAD_SYSTEM);
List<Point> sysCpuLoadPoints = sysCpuLoadChart.getPoints();
assertEquals(5, sysCpuLoadPoints.size());
index = sysCpuLoadPoints.size();
for (Point point : sysCpuLoadPoints) {
testSysCpuLoad((DoubleApplicationStatPoint) point, aggreCpuLoadList.get(--index));
}
}
Aggregations