Search in sources :

Example 36 with JvmGcBo

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

the class JvmGcCodecV1 method encodeValues.

@Override
public void encodeValues(Buffer valueBuffer, List<JvmGcBo> jvmGcBos) {
    if (CollectionUtils.isEmpty(jvmGcBos)) {
        throw new IllegalArgumentException("jvmGcBos must not be empty");
    }
    final int gcTypeCode = jvmGcBos.get(0).getGcType().getTypeCode();
    valueBuffer.putVInt(gcTypeCode);
    final int numValues = jvmGcBos.size();
    valueBuffer.putVInt(numValues);
    List<Long> timestamps = new ArrayList<>(numValues);
    JvmGcCodecV2.JvmGcCodecEncoder encoder = new JvmGcCodecV2.JvmGcCodecEncoder(codec);
    for (JvmGcBo jvmGcBo : jvmGcBos) {
        timestamps.add(jvmGcBo.getTimestamp());
        encoder.addValue(jvmGcBo);
    }
    this.codec.encodeTimestamps(valueBuffer, timestamps);
    encoder.encode(valueBuffer);
}
Also used : JvmGcBo(com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo) JvmGcCodecV2(com.navercorp.pinpoint.common.server.bo.codec.stat.v2.JvmGcCodecV2) ArrayList(java.util.ArrayList)

Example 37 with JvmGcBo

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

the class JvmGcCodecV2 method encodeValues.

@Override
public void encodeValues(Buffer valueBuffer, List<JvmGcBo> jvmGcBos) {
    if (CollectionUtils.isEmpty(jvmGcBos)) {
        throw new IllegalArgumentException("jvmGcBos must not be empty");
    }
    final int gcTypeCode = jvmGcBos.get(0).getGcType().getTypeCode();
    valueBuffer.putVInt(gcTypeCode);
    final int numValues = jvmGcBos.size();
    valueBuffer.putVInt(numValues);
    List<Long> startTimestamps = new ArrayList<>(numValues);
    List<Long> timestamps = new ArrayList<>(numValues);
    JvmGcCodecEncoder jvmGcCodecEncoder = new JvmGcCodecEncoder(codec);
    for (JvmGcBo jvmGcBo : jvmGcBos) {
        startTimestamps.add(jvmGcBo.getStartTimestamp());
        timestamps.add(jvmGcBo.getTimestamp());
        jvmGcCodecEncoder.addValue(jvmGcBo);
    }
    this.codec.encodeValues(valueBuffer, UnsignedLongEncodingStrategy.REPEAT_COUNT, startTimestamps);
    this.codec.encodeTimestamps(valueBuffer, timestamps);
    jvmGcCodecEncoder.encode(valueBuffer);
}
Also used : JvmGcBo(com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo) ArrayList(java.util.ArrayList)

Example 38 with JvmGcBo

use of com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo 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 39 with JvmGcBo

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

the class HbaseSampledJvmGcDaoV2 method getSampledAgentStatList.

@Override
public List<SampledJvmGc> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
    long scanFrom = timeWindow.getWindowRange().getFrom();
    long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
    Range range = Range.newRange(scanFrom, scanTo);
    AgentStatMapperV2<JvmGcBo> mapper = operations.createRowMapper(jvmGcDecoder, range);
    SampledAgentStatResultExtractor<JvmGcBo, SampledJvmGc> resultExtractor = new SampledAgentStatResultExtractor<>(timeWindow, mapper, jvmGcSampler);
    return operations.getSampledAgentStatList(AgentStatType.JVM_GC, resultExtractor, agentId, range);
}
Also used : JvmGcBo(com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo) SampledAgentStatResultExtractor(com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor) SampledJvmGc(com.navercorp.pinpoint.web.vo.stat.SampledJvmGc) Range(com.navercorp.pinpoint.web.vo.Range)

Aggregations

JvmGcBo (com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo)39 SampledJvmGc (com.navercorp.pinpoint.web.vo.stat.SampledJvmGc)15 Test (org.junit.Test)13 CpuLoadBo (com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo)10 Range (com.navercorp.pinpoint.web.vo.Range)10 ArrayList (java.util.ArrayList)7 ApplicationIndexDao (com.navercorp.pinpoint.web.dao.ApplicationIndexDao)6 LinkedList (java.util.LinkedList)6 List (java.util.List)6 BeforeClass (org.junit.BeforeClass)6 AgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)4 JvmGcType (com.navercorp.pinpoint.common.server.bo.JvmGcType)3 AgentStatHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder)2 BitCountingHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder)2 JvmGcCodecV2 (com.navercorp.pinpoint.common.server.bo.codec.stat.v2.JvmGcCodecV2)2 ActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)2 DataSourceBo (com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo)2 DataSourceListBo (com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo)2 JvmGcDetailedBo (com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo)2 TransactionBo (com.navercorp.pinpoint.common.server.bo.stat.TransactionBo)2