use of com.navercorp.pinpoint.web.vo.chart.Point in project pinpoint by naver.
the class DataSourceChartGroupTest method assertEquals.
private void assertEquals(List<SampledDataSource> sampledDataSourceList, DataSourceChartGroup dataSourceChartGroup) {
Map<AgentStatChartGroup.ChartType, Chart> charts = dataSourceChartGroup.getCharts();
Chart activeConnectionSizeChart = charts.get(DataSourceChartGroup.DataSourceChartType.ACTIVE_CONNECTION_SIZE);
List<Point> activeConnectionSizeChartPointList = activeConnectionSizeChart.getPoints();
for (int i = 0; i < sampledDataSourceList.size(); i++) {
SampledDataSource sampledDataSource = sampledDataSourceList.get(i);
Point<Long, Integer> point = sampledDataSource.getActiveConnectionSize();
Assert.assertEquals(activeConnectionSizeChartPointList.get(i), point);
}
Chart maxConnectionSizeChart = charts.get(DataSourceChartGroup.DataSourceChartType.MAX_CONNECTION_SIZE);
List<Point> maxConnectionSizeChartPointList = maxConnectionSizeChart.getPoints();
for (int i = 0; i < sampledDataSourceList.size(); i++) {
SampledDataSource sampledDataSource = sampledDataSourceList.get(i);
Point<Long, Integer> point = sampledDataSource.getMaxConnectionSize();
Assert.assertEquals(maxConnectionSizeChartPointList.get(i), point);
}
}
use of com.navercorp.pinpoint.web.vo.chart.Point in project pinpoint by naver.
the class StatChartGroupSerializer method serialize.
@Override
public void serialize(StatChartGroup statChartGroup, JsonGenerator jgen, SerializerProvider serializers) throws IOException, JsonProcessingException {
jgen.writeStartObject();
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = statChartGroup.getCharts();
writeSchema(jgen, charts.keySet());
TimeWindow timeWindow = statChartGroup.getTimeWindow();
writeTimestamp(jgen, timeWindow);
writeCharts(jgen, charts);
jgen.writeEndObject();
}
use of com.navercorp.pinpoint.web.vo.chart.Point in project pinpoint by naver.
the class ApplicationDataSourceChartGroupTest method createApplicationDataSourceChartGroup.
@Test
public void createApplicationDataSourceChartGroup() {
long time = 1495418083250L;
Range range = Range.newRange(time - 240000, time);
TimeWindow timeWindow = new TimeWindow(range);
List<AggreJoinDataSourceBo> aggreJoinDataSourceBoList = new ArrayList<>();
AggreJoinDataSourceBo aggreJoinDataSourceBo1 = new AggreJoinDataSourceBo((short) 1000, "jdbc:mysql", 30, 25, "agent_id_1", 60, "agent_id_6", time);
AggreJoinDataSourceBo aggreJoinDataSourceBo2 = new AggreJoinDataSourceBo((short) 1000, "jdbc:mysql", 20, 5, "agent_id_2", 30, "agent_id_7", time - 60000);
AggreJoinDataSourceBo aggreJoinDataSourceBo3 = new AggreJoinDataSourceBo((short) 1000, "jdbc:mysql", 10, 25, "agent_id_3", 50, "agent_id_8", time - 120000);
AggreJoinDataSourceBo aggreJoinDataSourceBo4 = new AggreJoinDataSourceBo((short) 1000, "jdbc:mysql", 40, 4, "agent_id_4", 70, "agent_id_9", time - 180000);
AggreJoinDataSourceBo aggreJoinDataSourceBo5 = new AggreJoinDataSourceBo((short) 1000, "jdbc:mysql", 50, 25, "agent_id_5", 80, "agent_id_10", time - 240000);
aggreJoinDataSourceBoList.add(aggreJoinDataSourceBo1);
aggreJoinDataSourceBoList.add(aggreJoinDataSourceBo2);
aggreJoinDataSourceBoList.add(aggreJoinDataSourceBo3);
aggreJoinDataSourceBoList.add(aggreJoinDataSourceBo4);
aggreJoinDataSourceBoList.add(aggreJoinDataSourceBo5);
StatChartGroup applicationDataSourceChartGroup = new ApplicationDataSourceChart.ApplicationDataSourceChartGroup(timeWindow, "jdbc:mysql", "dbcp2", aggreJoinDataSourceBoList);
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationDataSourceChartGroup.getCharts();
assertEquals(1, charts.size());
Chart dataSourceChart = charts.get(ApplicationDataSourceChart.ApplicationDataSourceChartGroup.DataSourceChartType.ACTIVE_CONNECTION_SIZE);
List<Point> dataSourcePoints = dataSourceChart.getPoints();
assertEquals(5, dataSourcePoints.size());
int index = dataSourcePoints.size();
for (Point point : dataSourcePoints) {
testDataSource((IntApplicationStatPoint) point, aggreJoinDataSourceBoList.get(--index));
}
}
use of com.navercorp.pinpoint.web.vo.chart.Point in project pinpoint by naver.
the class ApplicationFileDescriptorChartGroupTest method createApplicationFileDescriptorChartGroupTest.
@Test
public void createApplicationFileDescriptorChartGroupTest() {
long time = 1495418083250L;
Range range = Range.newRange(time - 240000, time);
TimeWindow timeWindow = new TimeWindow(range);
List<AggreJoinFileDescriptorBo> aggreFileDescriptorList = new ArrayList<>(5);
AggreJoinFileDescriptorBo aggreJoinFileDescriptorBo1 = new AggreJoinFileDescriptorBo("testApp", 11, 60, "agent1_1", 20, "agent1_2", time);
AggreJoinFileDescriptorBo aggreJoinFileDescriptorBo2 = new AggreJoinFileDescriptorBo("testApp", 22, 52, "agent2_1", 10, "agent2_2", time - 60000);
AggreJoinFileDescriptorBo aggreJoinFileDescriptorBo3 = new AggreJoinFileDescriptorBo("testApp", 33, 39, "agent3_1", 9, "agent3_2", time - 120000);
AggreJoinFileDescriptorBo aggreJoinFileDescriptorBo4 = new AggreJoinFileDescriptorBo("testApp", 44, 42, "agent4_1", 25, "agent4_2", time - 180000);
AggreJoinFileDescriptorBo aggreJoinFileDescriptorBo5 = new AggreJoinFileDescriptorBo("testApp", 55, 55, "agent5_1", 54, "agent5_2", time - 240000);
aggreFileDescriptorList.add(aggreJoinFileDescriptorBo1);
aggreFileDescriptorList.add(aggreJoinFileDescriptorBo2);
aggreFileDescriptorList.add(aggreJoinFileDescriptorBo3);
aggreFileDescriptorList.add(aggreJoinFileDescriptorBo4);
aggreFileDescriptorList.add(aggreJoinFileDescriptorBo5);
StatChartGroup applicationFileDescriptorChartGroup = new ApplicationFileDescriptorChart.ApplicationFileDescriptorChartGroup(timeWindow, aggreFileDescriptorList);
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = applicationFileDescriptorChartGroup.getCharts();
assertEquals(1, charts.size());
Chart fileDescriptorChart = charts.get(ApplicationFileDescriptorChart.ApplicationFileDescriptorChartGroup.FileDescriptorChartType.OPEN_FILE_DESCRIPTOR_COUNT);
List<Point> fileDescriptorPoints = fileDescriptorChart.getPoints();
assertEquals(5, fileDescriptorPoints.size());
int index = fileDescriptorPoints.size();
for (Point point : fileDescriptorPoints) {
testOpenFileDescriptor((LongApplicationStatPoint) point, aggreFileDescriptorList.get(--index));
}
}
use of com.navercorp.pinpoint.web.vo.chart.Point 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));
}
}
Aggregations