Search in sources :

Example 1 with SampledResponseTime

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;
}
Also used : SampledResponseTime(com.navercorp.pinpoint.web.vo.stat.SampledResponseTime)

Example 2 with 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);
}
Also used : StatChartGroup(com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup) SampledResponseTime(com.navercorp.pinpoint.web.vo.stat.SampledResponseTime) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) Test(org.junit.Test)

Example 3 with SampledResponseTime

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;
}
Also used : SampledResponseTime(com.navercorp.pinpoint.web.vo.stat.SampledResponseTime) ArrayList(java.util.ArrayList) Point(com.navercorp.pinpoint.web.vo.chart.Point)

Example 4 with SampledResponseTime

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);
    }
}
Also used : SampledResponseTime(com.navercorp.pinpoint.web.vo.stat.SampledResponseTime) Point(com.navercorp.pinpoint.web.vo.chart.Point) Chart(com.navercorp.pinpoint.web.vo.chart.Chart) Point(com.navercorp.pinpoint.web.vo.chart.Point)

Example 5 with SampledResponseTime

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);
}
Also used : SampledResponseTime(com.navercorp.pinpoint.web.vo.stat.SampledResponseTime) SampledAgentStatResultExtractor(com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor) Range(com.navercorp.pinpoint.web.vo.Range) ResponseTimeBo(com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo)

Aggregations

SampledResponseTime (com.navercorp.pinpoint.web.vo.stat.SampledResponseTime)5 Point (com.navercorp.pinpoint.web.vo.chart.Point)2 ResponseTimeBo (com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo)1 SampledAgentStatResultExtractor (com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor)1 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 StatChartGroup (com.navercorp.pinpoint.web.vo.stat.chart.StatChartGroup)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1