Search in sources :

Example 1 with EachUriStatBo

use of com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo in project pinpoint by naver.

the class GrpcAgentUriStatMapper method createEachUriStatBo.

private EachUriStatBo createEachUriStatBo(PEachUriStat pEachUriStat) {
    EachUriStatBo eachUriStatBo = new EachUriStatBo();
    final String uri = pEachUriStat.getUri();
    eachUriStatBo.setUri(uri);
    PUriHistogram pTotalHistogram = pEachUriStat.getTotalHistogram();
    final UriStatHistogram totalHistogram = convertUriStatHistogram(pTotalHistogram);
    eachUriStatBo.setTotalHistogram(totalHistogram);
    PUriHistogram pFailedHistogram = pEachUriStat.getFailedHistogram();
    final UriStatHistogram failedHistogram = convertUriStatHistogram(pFailedHistogram);
    eachUriStatBo.setFailedHistogram(failedHistogram);
    return eachUriStatBo;
}
Also used : PUriHistogram(com.navercorp.pinpoint.grpc.trace.PUriHistogram) EachUriStatBo(com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo) UriStatHistogram(com.navercorp.pinpoint.common.server.bo.stat.UriStatHistogram)

Example 2 with EachUriStatBo

use of com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo in project pinpoint by naver.

the class EachUriStatCodecV2 method encodeValues.

@Override
public void encodeValues(Buffer valueBuffer, List<EachUriStatBo> eachUriStatBoList) {
    EachUriStatBoCodecEncoder eachUriStatBoCodecEncoder = new EachUriStatBoCodecEncoder(codec);
    for (EachUriStatBo eachUriStatBo : eachUriStatBoList) {
        eachUriStatBoCodecEncoder.addValue(eachUriStatBo);
    }
    eachUriStatBoCodecEncoder.encode(valueBuffer);
}
Also used : EachUriStatBo(com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo)

Example 3 with EachUriStatBo

use of com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo in project pinpoint by naver.

the class SampledUriStatResultExtractor method divideByUri.

private Map<String, List<EachUriStatBo>> divideByUri(ResultScanner results) throws Exception {
    Map<String, List<EachUriStatBo>> eachUriStatBoListMap = new HashMap<>();
    int rowNum = 0;
    for (Result result : results) {
        for (AgentUriStatBo agentUriStatBo : this.rowMapper.mapRow(result, rowNum++)) {
            List<EachUriStatBo> eachUriStatBoList = agentUriStatBo.getEachUriStatBoList();
            if (CollectionUtils.isEmpty(eachUriStatBoList)) {
                continue;
            }
            final String agentId = agentUriStatBo.getAgentId();
            final long startTimestamp = agentUriStatBo.getStartTimestamp();
            final long timestamp = agentUriStatBo.getTimestamp();
            for (EachUriStatBo eachUriStatBo : eachUriStatBoList) {
                String uri = eachUriStatBo.getUri();
                List<EachUriStatBo> eachUriStatBos = eachUriStatBoListMap.computeIfAbsent(uri, k -> new ArrayList<>());
                setAgentStatDataPointBaseData(eachUriStatBo, agentId, startTimestamp, timestamp);
                eachUriStatBos.add(eachUriStatBo);
            }
        }
    }
    return eachUriStatBoListMap;
}
Also used : AgentUriStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) List(java.util.List) EachUriStatBo(com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo) SampledEachUriStatBo(com.navercorp.pinpoint.web.vo.stat.SampledEachUriStatBo) AgentStatDataPoint(com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint) Result(org.apache.hadoop.hbase.client.Result)

Example 4 with EachUriStatBo

use of com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo in project pinpoint by naver.

the class AgentUriStatSampler method sampleDataPoints.

@Override
public SampledEachUriStatBo sampleDataPoints(int index, long timestamp, List<EachUriStatBo> eachUriStatBoList, EachUriStatBo previousDataPoint) {
    if (CollectionUtils.isEmpty(eachUriStatBoList)) {
        return null;
    }
    final String uri = getUri(eachUriStatBoList);
    List<UriStatHistogram> totalUriStatHistogramList = eachUriStatBoList.stream().map(EachUriStatBo::getTotalHistogram).filter(Objects::nonNull).collect(Collectors.toList());
    SampledUriStatHistogramBo sampledTotalUriStatHistogramBo = create(timestamp, totalUriStatHistogramList);
    List<UriStatHistogram> failedUriStatHistogramList = eachUriStatBoList.stream().map(EachUriStatBo::getFailedHistogram).filter(Objects::nonNull).collect(Collectors.toList());
    SampledUriStatHistogramBo failedSampledUriStatHistogramBo = create(timestamp, failedUriStatHistogramList);
    SampledEachUriStatBo sampledEachUriStatBo = new SampledEachUriStatBo(uri, sampledTotalUriStatHistogramBo, failedSampledUriStatHistogramBo);
    return sampledEachUriStatBo;
}
Also used : SampledEachUriStatBo(com.navercorp.pinpoint.web.vo.stat.SampledEachUriStatBo) SampledUriStatHistogramBo(com.navercorp.pinpoint.web.vo.stat.SampledUriStatHistogramBo) EachUriStatBo(com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo) SampledEachUriStatBo(com.navercorp.pinpoint.web.vo.stat.SampledEachUriStatBo) UriStatHistogram(com.navercorp.pinpoint.common.server.bo.stat.UriStatHistogram)

Example 5 with EachUriStatBo

use of com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo in project pinpoint by naver.

the class AgentUriStatSamplerTest method sampleTest.

@Test
public void sampleTest() {
    AgentUriStatSampler sampler = new AgentUriStatSampler();
    long currentTimeMillis = System.currentTimeMillis();
    long startTimestamp = currentTimeMillis - TimeUnit.DAYS.toMillis(30);
    List<EachUriStatBo> eachUriStatBoList = new ArrayList<>();
    eachUriStatBoList.add(createEachUriStatBo("agentId", startTimestamp, currentTimeMillis, "/index.html"));
    eachUriStatBoList.add(createEachUriStatBo("agentId", startTimestamp, currentTimeMillis, "/index.html"));
    SampledEachUriStatBo sampledEachUriStatBo = sampler.sampleDataPoints(0, System.currentTimeMillis(), eachUriStatBoList, null);
    SampledUriStatHistogramBo totalSampledUriStatHistogramBo = sampledEachUriStatBo.getTotalSampledUriStatHistogramBo();
    AgentStatPoint<Long> maxTimePoint = totalSampledUriStatHistogramBo.getMaxTimePoint();
    assertMaxValue(maxTimePoint, eachUriStatBoList);
    AgentStatPoint<Integer> countPoint = totalSampledUriStatHistogramBo.getCountPoint();
    assertCountValue(countPoint, eachUriStatBoList);
    int[] uriStatHistogramValue = totalSampledUriStatHistogramBo.getUriStatHistogramValue();
    assertHistogramValue(uriStatHistogramValue, eachUriStatBoList);
}
Also used : ArrayList(java.util.ArrayList) SampledEachUriStatBo(com.navercorp.pinpoint.web.vo.stat.SampledEachUriStatBo) SampledUriStatHistogramBo(com.navercorp.pinpoint.web.vo.stat.SampledUriStatHistogramBo) EachUriStatBo(com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo) SampledEachUriStatBo(com.navercorp.pinpoint.web.vo.stat.SampledEachUriStatBo) Test(org.junit.Test)

Aggregations

EachUriStatBo (com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo)12 SampledEachUriStatBo (com.navercorp.pinpoint.web.vo.stat.SampledEachUriStatBo)6 AgentUriStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo)4 ArrayList (java.util.ArrayList)3 UriStatHistogram (com.navercorp.pinpoint.common.server.bo.stat.UriStatHistogram)2 SampledUriStatHistogramBo (com.navercorp.pinpoint.web.vo.stat.SampledUriStatHistogramBo)2 AgentStatHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder)1 BitCountingHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder)1 AgentStatDataPoint (com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint)1 Header (com.navercorp.pinpoint.grpc.Header)1 PEachUriStat (com.navercorp.pinpoint.grpc.trace.PEachUriStat)1 PUriHistogram (com.navercorp.pinpoint.grpc.trace.PUriHistogram)1 EagerSamplingHandler (com.navercorp.pinpoint.web.mapper.stat.sampling.EagerSamplingHandler)1 SampledAgentUriStat (com.navercorp.pinpoint.web.vo.stat.SampledAgentUriStat)1 AgentStatPoint (com.navercorp.pinpoint.web.vo.stat.chart.agent.AgentStatPoint)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Result (org.apache.hadoop.hbase.client.Result)1 Test (org.junit.Test)1