Search in sources :

Example 26 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<Long>(numValues);
    UnsignedLongEncodingStrategy.Analyzer.Builder heapUsedAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
    UnsignedLongEncodingStrategy.Analyzer.Builder heapMaxAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
    UnsignedLongEncodingStrategy.Analyzer.Builder nonHeapUsedAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
    UnsignedLongEncodingStrategy.Analyzer.Builder nonHeapMaxAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
    UnsignedLongEncodingStrategy.Analyzer.Builder gcOldCountAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
    UnsignedLongEncodingStrategy.Analyzer.Builder gcOldTimeAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
    for (JvmGcBo jvmGcBo : jvmGcBos) {
        timestamps.add(jvmGcBo.getTimestamp());
        heapUsedAnalyzerBuilder.addValue(jvmGcBo.getHeapUsed());
        heapMaxAnalyzerBuilder.addValue(jvmGcBo.getHeapMax());
        nonHeapUsedAnalyzerBuilder.addValue(jvmGcBo.getNonHeapUsed());
        nonHeapMaxAnalyzerBuilder.addValue(jvmGcBo.getNonHeapMax());
        gcOldCountAnalyzerBuilder.addValue(jvmGcBo.getGcOldCount());
        gcOldTimeAnalyzerBuilder.addValue(jvmGcBo.getGcOldTime());
    }
    this.codec.encodeTimestamps(valueBuffer, timestamps);
    this.encodeDataPoints(valueBuffer, heapUsedAnalyzerBuilder.build(), heapMaxAnalyzerBuilder.build(), nonHeapUsedAnalyzerBuilder.build(), nonHeapMaxAnalyzerBuilder.build(), gcOldCountAnalyzerBuilder.build(), gcOldTimeAnalyzerBuilder.build());
}
Also used : JvmGcBo(com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo) UnsignedLongEncodingStrategy(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.UnsignedLongEncodingStrategy) ArrayList(java.util.ArrayList) StrategyAnalyzer(com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.StrategyAnalyzer)

Example 27 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 = new Range(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)

Example 28 with JvmGcBo

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

the class JvmGcSamplerTest method createJvmGcBoForGcTest.

private JvmGcBo createJvmGcBoForGcTest(long startTimestamp, long gcOldCount, long gcOldTime) {
    JvmGcBo jvmGcBo = createJvmGcBoForGcTest(gcOldCount, gcOldTime);
    jvmGcBo.setStartTimestamp(startTimestamp);
    return jvmGcBo;
}
Also used : JvmGcBo(com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo)

Aggregations

JvmGcBo (com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo)28 SampledJvmGc (com.navercorp.pinpoint.web.vo.stat.SampledJvmGc)15 Test (org.junit.Test)12 ArrayList (java.util.ArrayList)7 CpuLoadBo (com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo)6 Range (com.navercorp.pinpoint.web.vo.Range)6 JvmGcType (com.navercorp.pinpoint.common.server.bo.JvmGcType)3 ApplicationIndexDao (com.navercorp.pinpoint.web.dao.ApplicationIndexDao)3 LinkedList (java.util.LinkedList)3 List (java.util.List)3 BeforeClass (org.junit.BeforeClass)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 StrategyAnalyzer (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.StrategyAnalyzer)2 UnsignedLongEncodingStrategy (com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.UnsignedLongEncodingStrategy)2 ActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)2 AgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)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