Search in sources :

Example 21 with BitCountingHeaderDecoder

use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder in project pinpoint by naver.

the class CpuLoadCodec method decodeValues.

@Override
public List<JoinStatBo> decodeValues(Buffer valueBuffer, ApplicationStatDecodingContext decodingContext) {
    final String id = decodingContext.getApplicationId();
    final long baseTimestamp = decodingContext.getBaseTimestamp();
    final long timestampDelta = decodingContext.getTimestampDelta();
    final long initialTimestamp = baseTimestamp + timestampDelta;
    int numValues = valueBuffer.readVInt();
    List<Long> timestamps = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);
    // decode headers
    final byte[] header = valueBuffer.readPrefixedBytes();
    AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
    JoinLongFieldEncodingStrategy jvmCpuLoadEncodingStrategy = JoinLongFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode());
    JoinLongFieldEncodingStrategy systemCpuLoadEncodingStrategy = JoinLongFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode());
    // decode values
    final List<JoinLongFieldBo> jvmCpuLoadList = this.codec.decodeValues(valueBuffer, jvmCpuLoadEncodingStrategy, numValues);
    final List<JoinLongFieldBo> systemCpuLoadList = this.codec.decodeValues(valueBuffer, systemCpuLoadEncodingStrategy, numValues);
    List<JoinStatBo> joinCpuLoadBoList = new ArrayList<>(numValues);
    for (int i = 0; i < numValues; i++) {
        JoinCpuLoadBo joinCpuLoadBo = new JoinCpuLoadBo();
        joinCpuLoadBo.setId(id);
        joinCpuLoadBo.setTimestamp(timestamps.get(i));
        joinCpuLoadBo.setJvmCpuLoadJoinValue(jvmCpuLoadList.get(i).toLongFieldBo());
        joinCpuLoadBo.setSystemCpuLoadJoinValue(systemCpuLoadList.get(i).toLongFieldBo());
        joinCpuLoadBoList.add(joinCpuLoadBo);
    }
    return joinCpuLoadBoList;
}
Also used : BitCountingHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder) ArrayList(java.util.ArrayList) JoinStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo) JoinLongFieldEncodingStrategy(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldEncodingStrategy) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) AgentStatHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder) JoinCpuLoadBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinCpuLoadBo)

Example 22 with BitCountingHeaderDecoder

use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder 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 23 with BitCountingHeaderDecoder

use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder in project pinpoint by naver.

the class JvmGcCodecV2 method decodeValues.

@Override
public List<JvmGcBo> decodeValues(Buffer valueBuffer, AgentStatDecodingContext decodingContext) {
    final String agentId = decodingContext.getAgentId();
    final long baseTimestamp = decodingContext.getBaseTimestamp();
    final long timestampDelta = decodingContext.getTimestampDelta();
    final long initialTimestamp = baseTimestamp + timestampDelta;
    final JvmGcType gcType = JvmGcType.getTypeByCode(valueBuffer.readVInt());
    int numValues = valueBuffer.readVInt();
    List<Long> startTimestamps = this.codec.decodeValues(valueBuffer, UnsignedLongEncodingStrategy.REPEAT_COUNT, numValues);
    List<Long> timestamps = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);
    // decode headers
    final byte[] header = valueBuffer.readPrefixedBytes();
    AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
    JvmGcCodecDecoder decoder = new JvmGcCodecDecoder(codec);
    decoder.decode(valueBuffer, headerDecoder, numValues);
    List<JvmGcBo> jvmGcBos = new ArrayList<>(numValues);
    for (int i = 0; i < numValues; i++) {
        JvmGcBo jvmGcBo = decoder.getValue(i);
        jvmGcBo.setAgentId(agentId);
        jvmGcBo.setStartTimestamp(startTimestamps.get(i));
        jvmGcBo.setTimestamp(timestamps.get(i));
        jvmGcBo.setGcType(gcType);
        jvmGcBos.add(jvmGcBo);
    }
    return jvmGcBos;
}
Also used : JvmGcBo(com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo) BitCountingHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder) ArrayList(java.util.ArrayList) JvmGcType(com.navercorp.pinpoint.common.server.bo.JvmGcType) AgentStatHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder)

Example 24 with BitCountingHeaderDecoder

use of com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder in project pinpoint by naver.

the class TransactionCodec method decodeValues.

@Override
public List<JoinStatBo> decodeValues(Buffer valueBuffer, ApplicationStatDecodingContext decodingContext) {
    final String id = decodingContext.getApplicationId();
    final long baseTimestamp = decodingContext.getBaseTimestamp();
    final long timestampDelta = decodingContext.getTimestampDelta();
    final long initialTimestamp = baseTimestamp + timestampDelta;
    int numValues = valueBuffer.readVInt();
    List<Long> timestampList = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);
    // decode headers
    final byte[] header = valueBuffer.readPrefixedBytes();
    AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
    EncodingStrategy<Long> collectIntervalEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
    JoinLongFieldEncodingStrategy totalCountEncodingStrategy = JoinLongFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode());
    List<Long> collectIntervalList = this.codec.decodeValues(valueBuffer, collectIntervalEncodingStrategy, numValues);
    final List<JoinLongFieldBo> totalCountList = this.codec.decodeValues(valueBuffer, totalCountEncodingStrategy, numValues);
    List<JoinStatBo> joinTransactionBoList = new ArrayList<>();
    for (int i = 0; i < numValues; i++) {
        JoinTransactionBo joinTransactionBo = new JoinTransactionBo();
        joinTransactionBo.setId(id);
        joinTransactionBo.setTimestamp(timestampList.get(i));
        joinTransactionBo.setCollectInterval(collectIntervalList.get(i));
        joinTransactionBo.setTotalCountJoinValue(totalCountList.get(i));
        joinTransactionBoList.add(joinTransactionBo);
    }
    return joinTransactionBoList;
}
Also used : BitCountingHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder) ArrayList(java.util.ArrayList) JoinStatBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo) JoinLongFieldEncodingStrategy(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldEncodingStrategy) JoinLongFieldBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo) AgentStatHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder) JoinTransactionBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo)

Aggregations

AgentStatHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder)24 BitCountingHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder)24 ArrayList (java.util.ArrayList)23 JoinStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo)9 JoinLongFieldEncodingStrategy (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinLongFieldEncodingStrategy)8 JoinLongFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo)8 JvmGcType (com.navercorp.pinpoint.common.server.bo.JvmGcType)2 JoinIntFieldEncodingStrategy (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinIntFieldEncodingStrategy)2 ActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)2 AgentStatDataPoint (com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint)2 CpuLoadBo (com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo)2 JvmGcBo (com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo)2 JvmGcDetailedBo (com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo)2 TransactionBo (com.navercorp.pinpoint.common.server.bo.stat.TransactionBo)2 JoinIntFieldBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinIntFieldBo)2 SlotType (com.navercorp.pinpoint.common.trace.SlotType)2 HashMap (java.util.HashMap)2 AgentStatDataPointCodec (com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDataPointCodec)1 JvmGcCodecV2 (com.navercorp.pinpoint.common.server.bo.codec.stat.v2.JvmGcCodecV2)1 DataSourceBo (com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo)1