use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo in project pinpoint by naver.
the class MemoryCodec method encodeValues.
public void encodeValues(Buffer valueBuffer, List<JoinStatBo> joinMemoryBoList) {
if (CollectionUtils.isEmpty(joinMemoryBoList)) {
throw new IllegalArgumentException("MemoryBoList must not be empty");
}
final int numValues = joinMemoryBoList.size();
valueBuffer.putVInt(numValues);
List<Long> timestamps = new ArrayList<>(numValues);
JoinLongFieldStrategyAnalyzer.Builder heapUsedAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();
JoinLongFieldStrategyAnalyzer.Builder nonHeapUsedAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();
for (JoinStatBo joinStatBo : joinMemoryBoList) {
JoinMemoryBo joinMemoryBo = (JoinMemoryBo) joinStatBo;
timestamps.add(joinMemoryBo.getTimestamp());
heapUsedAnalyzerBuilder.addValue(joinMemoryBo.getHeapUsedJoinValue());
nonHeapUsedAnalyzerBuilder.addValue(joinMemoryBo.getNonHeapUsedJoinValue());
}
codec.encodeTimestamps(valueBuffer, timestamps);
encodeDataPoints(valueBuffer, heapUsedAnalyzerBuilder.build(), nonHeapUsedAnalyzerBuilder.build());
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo 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;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo in project pinpoint by naver.
the class DirectBufferCodec method encodeValues.
@Override
public void encodeValues(Buffer valueBuffer, List<JoinStatBo> joinDirectBufferBoList) {
if (CollectionUtils.isEmpty(joinDirectBufferBoList)) {
throw new IllegalArgumentException("directBufferBoList must not be empty");
}
final int numValues = joinDirectBufferBoList.size();
valueBuffer.putVInt(numValues);
List<Long> timestamps = new ArrayList<>(numValues);
JoinLongFieldStrategyAnalyzer.Builder directCountAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();
JoinLongFieldStrategyAnalyzer.Builder directMemoryUsedAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();
JoinLongFieldStrategyAnalyzer.Builder mappedCountAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();
JoinLongFieldStrategyAnalyzer.Builder mappedMemoryUsedAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();
for (JoinStatBo joinStatBo : joinDirectBufferBoList) {
JoinDirectBufferBo joinDirectBufferBo = (JoinDirectBufferBo) joinStatBo;
timestamps.add(joinDirectBufferBo.getTimestamp());
directCountAnalyzerBuilder.addValue(joinDirectBufferBo.getDirectCountJoinValue());
directMemoryUsedAnalyzerBuilder.addValue(joinDirectBufferBo.getDirectMemoryUsedJoinValue());
mappedCountAnalyzerBuilder.addValue(joinDirectBufferBo.getMappedCountJoinValue());
mappedMemoryUsedAnalyzerBuilder.addValue(joinDirectBufferBo.getMappedMemoryUsedJoinValue());
}
codec.encodeTimestamps(valueBuffer, timestamps);
encodeDataPoints(valueBuffer, directCountAnalyzerBuilder.build(), directMemoryUsedAnalyzerBuilder.build(), mappedCountAnalyzerBuilder.build(), mappedMemoryUsedAnalyzerBuilder.build());
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo in project pinpoint by naver.
the class TransactionCodec method encodeValues.
@Override
public void encodeValues(Buffer valueBuffer, List<JoinStatBo> joinTransactionBoList) {
if (CollectionUtils.isEmpty(joinTransactionBoList)) {
throw new IllegalArgumentException("joinTransactionBoList must not be empty");
}
final int numValues = joinTransactionBoList.size();
valueBuffer.putVInt(numValues);
List<Long> timestamps = new ArrayList<>(numValues);
UnsignedLongEncodingStrategy.Analyzer.Builder collectIntervalAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
JoinLongFieldStrategyAnalyzer.Builder totalCountAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();
for (JoinStatBo joinStatBo : joinTransactionBoList) {
JoinTransactionBo joinTransactionBo = (JoinTransactionBo) joinStatBo;
timestamps.add(joinTransactionBo.getTimestamp());
collectIntervalAnalyzerBuilder.addValue(joinTransactionBo.getCollectInterval());
totalCountAnalyzerBuilder.addValue(joinTransactionBo.getTotalCountJoinValue());
}
codec.encodeTimestamps(valueBuffer, timestamps);
encodeDataPoints(valueBuffer, collectIntervalAnalyzerBuilder.build(), totalCountAnalyzerBuilder.build());
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo in project pinpoint by naver.
the class LoadedClassCodec method encodeValues.
@Override
public void encodeValues(Buffer valueBuffer, List<JoinStatBo> joinStatBoList) {
if (CollectionUtils.isEmpty(joinStatBoList)) {
throw new IllegalArgumentException("directBufferBoList must not be empty");
}
final int numValues = joinStatBoList.size();
valueBuffer.putVInt(numValues);
List<Long> timestamps = new ArrayList<Long>(numValues);
JoinLongFieldStrategyAnalyzer.Builder loadedClassAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();
JoinLongFieldStrategyAnalyzer.Builder unloadedClassAnalyzerBuilder = new JoinLongFieldStrategyAnalyzer.Builder();
for (JoinStatBo joinStatBo : joinStatBoList) {
JoinLoadedClassBo joinLoadedClassBo = (JoinLoadedClassBo) joinStatBo;
timestamps.add(joinLoadedClassBo.getTimestamp());
loadedClassAnalyzerBuilder.addValue(joinLoadedClassBo.getLoadedClassJoinValue());
unloadedClassAnalyzerBuilder.addValue(joinLoadedClassBo.getUnloadedClassJoinValue());
}
codec.encodeTimestamps(valueBuffer, timestamps);
encodeDataPoints(valueBuffer, loadedClassAnalyzerBuilder.build(), unloadedClassAnalyzerBuilder.build());
}
Aggregations