Search in sources :

Example 6 with AgentStatHeaderDecoder

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

the class TotalThreadCountCodec 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);
    final byte[] header = valueBuffer.readPrefixedBytes();
    AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
    JoinLongFieldEncodingStrategy totalThreadCountEncodingStrategy = JoinLongFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode());
    final List<JoinLongFieldBo> totalThreadCountList = this.codec.decodeValues(valueBuffer, totalThreadCountEncodingStrategy, numValues);
    List<JoinStatBo> joinTotalThreadCountBoList = new ArrayList<JoinStatBo>();
    for (int i = 0; i < numValues; i++) {
        JoinTotalThreadCountBo joinTotalThreadCountBo = new JoinTotalThreadCountBo();
        joinTotalThreadCountBo.setId(id);
        joinTotalThreadCountBo.setTimestamp(timestampList.get(i));
        joinTotalThreadCountBo.setTotalThreadCountJoinValue(totalThreadCountList.get(i));
        joinTotalThreadCountBoList.add(joinTotalThreadCountBo);
    }
    return joinTotalThreadCountBoList;
}
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) JoinTotalThreadCountBo(com.navercorp.pinpoint.common.server.bo.stat.join.JoinTotalThreadCountBo) 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)

Example 7 with AgentStatHeaderDecoder

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

the class AgentStatCodecV1 method decodeValues.

@Override
public List<T> 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;
    int numValues = valueBuffer.readVInt();
    List<Long> timestamps = this.codecFactory.getCodec().decodeTimestamps(initialTimestamp, valueBuffer, numValues);
    final CodecDecoder<T> codecDecoder = this.codecFactory.createCodecDecoder();
    // decode headers
    final byte[] header = valueBuffer.readPrefixedBytes();
    AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
    codecDecoder.decode(valueBuffer, headerDecoder, numValues);
    List<T> result = new ArrayList<T>(numValues);
    for (int i = 0; i < numValues; i++) {
        T newObject = codecDecoder.getValue(i);
        newObject.setAgentId(agentId);
        newObject.setTimestamp(timestamps.get(i));
        result.add(newObject);
    }
    return result;
}
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) AgentStatDataPoint(com.navercorp.pinpoint.common.server.bo.stat.AgentStatDataPoint)

Example 8 with AgentStatHeaderDecoder

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

the class JvmGcCodecV1 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> timestamps = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);
    // decode headers
    final byte[] header = valueBuffer.readPrefixedBytes();
    AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
    JvmGcCodecV2.JvmGcCodecDecoder decoder = new JvmGcCodecV2.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.setTimestamp(timestamps.get(i));
        jvmGcBo.setGcType(gcType);
        jvmGcBos.add(jvmGcBo);
    }
    return jvmGcBos;
}
Also used : JvmGcBo(com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo) JvmGcCodecV2(com.navercorp.pinpoint.common.server.bo.codec.stat.v2.JvmGcCodecV2) 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 9 with AgentStatHeaderDecoder

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

the class DataSourceCodecV2 method decodeValue.

private DataSourceListBo decodeValue(Buffer valueBuffer, AgentStatDecodingContext decodingContext) {
    final String agentId = decodingContext.getAgentId();
    final long baseTimestamp = decodingContext.getBaseTimestamp();
    final long timestampDelta = decodingContext.getTimestampDelta();
    final long initialTimestamp = baseTimestamp + timestampDelta;
    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);
    EncodingStrategy<Integer> idEncodingStrategy = UnsignedIntegerEncodingStrategy.getFromCode(headerDecoder.getCode());
    EncodingStrategy<Short> serviceTypeEncodingStrategy = UnsignedShortEncodingStrategy.getFromCode(headerDecoder.getCode());
    EncodingStrategy<String> databaseNameEncodingStrategy = StringEncodingStrategy.getFromCode(headerDecoder.getCode());
    EncodingStrategy<String> urlEncodingStrategy = StringEncodingStrategy.getFromCode(headerDecoder.getCode());
    EncodingStrategy<Integer> activeConnectionSizeStrategy = UnsignedIntegerEncodingStrategy.getFromCode(headerDecoder.getCode());
    EncodingStrategy<Integer> maxConnectionSizeStrategy = UnsignedIntegerEncodingStrategy.getFromCode(headerDecoder.getCode());
    List<Integer> ids = this.codec.decodeValues(valueBuffer, idEncodingStrategy, numValues);
    List<Short> serviceTypeCodes = this.codec.decodeValues(valueBuffer, serviceTypeEncodingStrategy, numValues);
    List<String> databaseNames = this.codec.decodeValues(valueBuffer, databaseNameEncodingStrategy, numValues);
    List<String> jdbcUrls = this.codec.decodeValues(valueBuffer, urlEncodingStrategy, numValues);
    List<Integer> activeConnectionSizes = this.codec.decodeValues(valueBuffer, activeConnectionSizeStrategy, numValues);
    List<Integer> maxConnectionSizes = this.codec.decodeValues(valueBuffer, maxConnectionSizeStrategy, numValues);
    DataSourceListBo dataSourceListBo = new DataSourceListBo();
    for (int i = 0; i < numValues; i++) {
        if (i == 0) {
            dataSourceListBo.setAgentId(agentId);
            dataSourceListBo.setTimestamp(timestamps.get(i));
            dataSourceListBo.setStartTimestamp(startTimestamps.get(i));
        }
        DataSourceBo dataSourceBo = new DataSourceBo();
        dataSourceBo.setAgentId(agentId);
        dataSourceBo.setStartTimestamp(startTimestamps.get(i));
        dataSourceBo.setTimestamp(timestamps.get(i));
        dataSourceBo.setId(ids.get(i));
        dataSourceBo.setServiceTypeCode(serviceTypeCodes.get(i));
        dataSourceBo.setDatabaseName(databaseNames.get(i));
        dataSourceBo.setJdbcUrl(jdbcUrls.get(i));
        dataSourceBo.setActiveConnectionSize(activeConnectionSizes.get(i));
        dataSourceBo.setMaxConnectionSize(maxConnectionSizes.get(i));
        dataSourceListBo.add(dataSourceBo);
    }
    return dataSourceListBo;
}
Also used : BitCountingHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder) DataSourceBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo) AgentStatHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder) DataSourceListBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo)

Example 10 with AgentStatHeaderDecoder

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

the class JvmGcDetailedCodecV2 method decodeValues.

@Override
public List<JvmGcDetailedBo> 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;
    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);
    EncodingStrategy<Long> gcNewCountEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
    EncodingStrategy<Long> gcNewTimeEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
    EncodingStrategy<Long> codeCacheUsedEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
    EncodingStrategy<Long> newGenUsedEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
    EncodingStrategy<Long> oldGenUsedEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
    EncodingStrategy<Long> survivorSpaceUsedEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
    EncodingStrategy<Long> permGenUsedEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
    EncodingStrategy<Long> metaspaceUsedEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
    // decode values
    List<Long> gcNewCounts = this.codec.decodeValues(valueBuffer, gcNewCountEncodingStrategy, numValues);
    List<Long> gcNewTimes = this.codec.decodeValues(valueBuffer, gcNewTimeEncodingStrategy, numValues);
    List<Long> codeCacheUseds = this.codec.decodeValues(valueBuffer, codeCacheUsedEncodingStrategy, numValues);
    List<Long> newGenUseds = this.codec.decodeValues(valueBuffer, newGenUsedEncodingStrategy, numValues);
    List<Long> oldGenUseds = this.codec.decodeValues(valueBuffer, oldGenUsedEncodingStrategy, numValues);
    List<Long> survivorSpaceUseds = this.codec.decodeValues(valueBuffer, survivorSpaceUsedEncodingStrategy, numValues);
    List<Long> permGenUseds = this.codec.decodeValues(valueBuffer, permGenUsedEncodingStrategy, numValues);
    List<Long> metaspaceUseds = this.codec.decodeValues(valueBuffer, metaspaceUsedEncodingStrategy, numValues);
    List<JvmGcDetailedBo> jvmGcDetailedBos = new ArrayList<JvmGcDetailedBo>(numValues);
    for (int i = 0; i < numValues; ++i) {
        JvmGcDetailedBo jvmGcDetailedBo = new JvmGcDetailedBo();
        jvmGcDetailedBo.setAgentId(agentId);
        jvmGcDetailedBo.setStartTimestamp(startTimestamps.get(i));
        jvmGcDetailedBo.setTimestamp(timestamps.get(i));
        jvmGcDetailedBo.setGcNewCount(gcNewCounts.get(i));
        jvmGcDetailedBo.setGcNewTime(gcNewTimes.get(i));
        jvmGcDetailedBo.setCodeCacheUsed(AgentStatUtils.convertLongToDouble(codeCacheUseds.get(i)));
        jvmGcDetailedBo.setNewGenUsed(AgentStatUtils.convertLongToDouble(newGenUseds.get(i)));
        jvmGcDetailedBo.setOldGenUsed(AgentStatUtils.convertLongToDouble(oldGenUseds.get(i)));
        jvmGcDetailedBo.setSurvivorSpaceUsed(AgentStatUtils.convertLongToDouble(survivorSpaceUseds.get(i)));
        jvmGcDetailedBo.setPermGenUsed(AgentStatUtils.convertLongToDouble(permGenUseds.get(i)));
        jvmGcDetailedBo.setMetaspaceUsed(AgentStatUtils.convertLongToDouble(metaspaceUseds.get(i)));
        jvmGcDetailedBos.add(jvmGcDetailedBo);
    }
    return jvmGcDetailedBos;
}
Also used : AgentStatHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder) JvmGcDetailedBo(com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo) BitCountingHeaderDecoder(com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder) ArrayList(java.util.ArrayList)

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