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());
}
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);
}
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;
}
Aggregations