Search in sources :

Example 11 with EachUriStatBo

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

the class EachUriStatCodecV2 method decodeValues.

@Override
public List<EachUriStatBo> decodeValues(Buffer valueBuffer, AgentStatDecodingContext decodingContext) {
    final int numValues = valueBuffer.readVInt();
    final byte[] header = valueBuffer.readPrefixedBytes();
    AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
    EachUriStatBoCodecDecoder eachUriStatBoCodecDecoder = new EachUriStatBoCodecDecoder(codec);
    eachUriStatBoCodecDecoder.decode(valueBuffer, headerDecoder, numValues);
    List<EachUriStatBo> eachUriStatBoList = new ArrayList<>(numValues);
    for (int i = 0; i < numValues; i++) {
        EachUriStatBo eachUriStatBo = eachUriStatBoCodecDecoder.getValue(i);
        eachUriStatBoList.add(eachUriStatBo);
    }
    return eachUriStatBoList;
}
Also used : AgentStatHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder) BitCountingHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder) ArrayList(java.util.ArrayList) EachUriStatBo(com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo)

Example 12 with EachUriStatBo

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

the class SampledUriStatResultExtractor method getSampleData.

private SampledAgentUriStat getSampleData(List<EachUriStatBo> eachUriStatBos) {
    eachUriStatBos.sort(Comparator.comparingLong(EachUriStatBo::getTimestamp).reversed());
    AgentStatSamplingHandler<EachUriStatBo, SampledEachUriStatBo> samplingHandler = new EagerSamplingHandler<>(timeWindow, sampler);
    for (EachUriStatBo eachUriStatBo : eachUriStatBos) {
        samplingHandler.addDataPoint(eachUriStatBo);
    }
    List<SampledEachUriStatBo> sampledDataPoints = samplingHandler.getSampledDataPoints();
    SampledAgentUriStat sampledAgentUriStat = new SampledAgentUriStat(sampledDataPoints);
    return sampledAgentUriStat;
}
Also used : SampledEachUriStatBo(com.navercorp.pinpoint.web.vo.stat.SampledEachUriStatBo) EachUriStatBo(com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo) SampledEachUriStatBo(com.navercorp.pinpoint.web.vo.stat.SampledEachUriStatBo) EagerSamplingHandler(com.navercorp.pinpoint.web.mapper.stat.sampling.EagerSamplingHandler) SampledAgentUriStat(com.navercorp.pinpoint.web.vo.stat.SampledAgentUriStat)

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