use of com.navercorp.pinpoint.web.vo.stat.SampledResponseTime in project pinpoint by naver.
the class ResponseTimeSampler method sampleDataPoints.
@Override
public SampledResponseTime sampleDataPoints(int timeWindowIndex, long timestamp, List<ResponseTimeBo> dataPoints, ResponseTimeBo previousDataPoint) {
List<Long> avgs = getAvg(dataPoints);
AgentStatPoint<Long> avg = createPoint(timestamp, avgs);
List<Long> maxs = getMax(dataPoints);
AgentStatPoint<Long> max = createPoint(timestamp, maxs);
SampledResponseTime sampledResponseTime = new SampledResponseTime(avg, max);
return sampledResponseTime;
}
use of com.navercorp.pinpoint.web.vo.stat.SampledResponseTime in project pinpoint by naver.
the class ResponseTimeChartGroupTest method basicFunctionTest1.
@Test
public void basicFunctionTest1() throws Exception {
long currentTimeMillis = System.currentTimeMillis();
TimeWindow timeWindow = new TimeWindow(Range.newRange(currentTimeMillis - 300000, currentTimeMillis));
List<SampledResponseTime> sampledResponseTimeList = createSampledResponseTimeList(timeWindow);
StatChartGroup responseTimeChartGroup = new ResponseTimeChart.ResponseTimeChartGroup(timeWindow, sampledResponseTimeList);
assertEquals(sampledResponseTimeList, responseTimeChartGroup);
}
use of com.navercorp.pinpoint.web.vo.stat.SampledResponseTime in project pinpoint by naver.
the class ResponseTimeChartGroupTest method createSampledResponseTimeList.
private List<SampledResponseTime> createSampledResponseTimeList(TimeWindow timeWindow) {
List<SampledResponseTime> sampledResponseTimeList = new ArrayList<>();
int maxConnectionSize = ThreadLocalRandom.current().nextInt(MIN_VALUE_OF_MAX_CONNECTION_SIZE) + MIN_VALUE_OF_MAX_CONNECTION_SIZE;
long from = timeWindow.getWindowRange().getFrom();
long to = timeWindow.getWindowRange().getTo();
for (long i = from; i < to; i += timeWindow.getWindowSlotSize()) {
sampledResponseTimeList.add(createSampledResponseTime(i, maxConnectionSize));
}
return sampledResponseTimeList;
}
use of com.navercorp.pinpoint.web.vo.stat.SampledResponseTime in project pinpoint by naver.
the class ResponseTimeChartGroupTest method assertEquals.
private void assertEquals(List<SampledResponseTime> sampledResponseTimeList, StatChartGroup responseTimeChartGroup) {
Map<StatChartGroup.ChartType, Chart<? extends Point>> charts = responseTimeChartGroup.getCharts();
Chart avgChart = charts.get(ResponseTimeChart.ResponseTimeChartGroup.ResponseTimeChartType.AVG);
List<Point> avgChartPointList = avgChart.getPoints();
for (int i = 0; i < sampledResponseTimeList.size(); i++) {
SampledResponseTime sampledResponseTime = sampledResponseTimeList.get(i);
Point point = sampledResponseTime.getAvg();
Assert.assertEquals(avgChartPointList.get(i), point);
}
Chart maxChart = charts.get(ResponseTimeChart.ResponseTimeChartGroup.ResponseTimeChartType.MAX);
List<Point> maxChartPointList = maxChart.getPoints();
for (int i = 0; i < sampledResponseTimeList.size(); i++) {
SampledResponseTime sampledResponseTime = sampledResponseTimeList.get(i);
Point point = sampledResponseTime.getMax();
Assert.assertEquals(maxChartPointList.get(i), point);
}
}
use of com.navercorp.pinpoint.web.vo.stat.SampledResponseTime in project pinpoint by naver.
the class HbaseSampledResponseTimeDaoV2 method getSampledAgentStatList.
@Override
public List<SampledResponseTime> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
long scanFrom = timeWindow.getWindowRange().getFrom();
long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
Range range = Range.newRange(scanFrom, scanTo);
AgentStatMapperV2<ResponseTimeBo> mapper = operations.createRowMapper(responseTimeDecoder, range);
SampledAgentStatResultExtractor<ResponseTimeBo, SampledResponseTime> resultExtractor = new SampledAgentStatResultExtractor<>(timeWindow, mapper, responseTimeSampler);
return operations.getSampledAgentStatList(AgentStatType.RESPONSE_TIME, resultExtractor, agentId, range);
}
Aggregations