use of com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo in project pinpoint by naver.
the class AgentStatBatchMapper method map.
@Override
public AgentStatBo map(TAgentStatBatch tAgentStatBatch) {
if (!tAgentStatBatch.isSetAgentStats()) {
return null;
}
AgentStatBo agentStatBo = new AgentStatBo();
final String agentId = tAgentStatBatch.getAgentId();
final long startTimestamp = tAgentStatBatch.getStartTimestamp();
agentStatBo.setAgentId(agentId);
List<JvmGcBo> jvmGcBos = new ArrayList<>(tAgentStatBatch.getAgentStatsSize());
List<JvmGcDetailedBo> jvmGcDetailedBos = new ArrayList<>(tAgentStatBatch.getAgentStatsSize());
List<CpuLoadBo> cpuLoadBos = new ArrayList<>(tAgentStatBatch.getAgentStatsSize());
List<TransactionBo> transactionBos = new ArrayList<>(tAgentStatBatch.getAgentStatsSize());
List<ActiveTraceBo> activeTraceBos = new ArrayList<>(tAgentStatBatch.getAgentStatsSize());
List<DataSourceListBo> dataSourceListBos = new ArrayList<DataSourceListBo>(tAgentStatBatch.getAgentStatsSize());
for (TAgentStat tAgentStat : tAgentStatBatch.getAgentStats()) {
final long timestamp = tAgentStat.getTimestamp();
// jvmGc
if (tAgentStat.isSetGc()) {
JvmGcBo jvmGcBo = this.jvmGcBoMapper.map(tAgentStat.getGc());
setBaseData(jvmGcBo, agentId, startTimestamp, timestamp);
jvmGcBos.add(jvmGcBo);
}
// jvmGcDetailed
if (tAgentStat.isSetGc()) {
if (tAgentStat.getGc().isSetJvmGcDetailed()) {
JvmGcDetailedBo jvmGcDetailedBo = this.jvmGcDetailedBoMapper.map(tAgentStat.getGc().getJvmGcDetailed());
setBaseData(jvmGcDetailedBo, agentId, startTimestamp, timestamp);
jvmGcDetailedBos.add(jvmGcDetailedBo);
}
}
// cpuLoad
if (tAgentStat.isSetCpuLoad()) {
CpuLoadBo cpuLoadBo = this.cpuLoadBoMapper.map(tAgentStat.getCpuLoad());
setBaseData(cpuLoadBo, agentId, startTimestamp, timestamp);
cpuLoadBos.add(cpuLoadBo);
}
// transaction
if (tAgentStat.isSetTransaction()) {
TransactionBo transactionBo = this.transactionBoMapper.map(tAgentStat.getTransaction());
setBaseData(transactionBo, agentId, startTimestamp, timestamp);
transactionBo.setCollectInterval(tAgentStat.getCollectInterval());
transactionBos.add(transactionBo);
}
// activeTrace
if (tAgentStat.isSetActiveTrace() && tAgentStat.getActiveTrace().isSetHistogram()) {
ActiveTraceBo activeTraceBo = this.activeTraceBoMapper.map(tAgentStat.getActiveTrace());
setBaseData(activeTraceBo, agentId, startTimestamp, timestamp);
activeTraceBos.add(activeTraceBo);
}
// datasource
if (tAgentStat.isSetDataSourceList()) {
DataSourceListBo dataSourceListBo = new DataSourceListBo();
setBaseData(dataSourceListBo, agentId, startTimestamp, timestamp);
TDataSourceList dataSourceList = tAgentStat.getDataSourceList();
if (dataSourceList.getDataSourceListSize() > 0) {
for (TDataSource dataSource : dataSourceList.getDataSourceList()) {
DataSourceBo dataSourceBo = dataSourceBoMapper.map(dataSource);
setBaseData(dataSourceBo, agentId, startTimestamp, timestamp);
dataSourceListBo.add(dataSourceBo);
}
}
dataSourceListBos.add(dataSourceListBo);
}
}
agentStatBo.setJvmGcBos(jvmGcBos);
agentStatBo.setJvmGcDetailedBos(jvmGcDetailedBos);
agentStatBo.setCpuLoadBos(cpuLoadBos);
agentStatBo.setTransactionBos(transactionBos);
agentStatBo.setActiveTraceBos(activeTraceBos);
agentStatBo.setDataSourceListBos(dataSourceListBos);
return agentStatBo;
}
use of com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo in project pinpoint by naver.
the class JvmGcDetailedBoMapper method map.
@Override
public JvmGcDetailedBo map(TJvmGcDetailed tJvmGcDetailed) {
JvmGcDetailedBo jvmGcDetailedBo = new JvmGcDetailedBo();
jvmGcDetailedBo.setGcNewCount(tJvmGcDetailed.getJvmGcNewCount());
jvmGcDetailedBo.setGcNewTime(tJvmGcDetailed.getJvmGcNewCount());
jvmGcDetailedBo.setCodeCacheUsed(tJvmGcDetailed.getJvmPoolCodeCacheUsed());
jvmGcDetailedBo.setNewGenUsed(tJvmGcDetailed.getJvmPoolNewGenUsed());
jvmGcDetailedBo.setOldGenUsed(tJvmGcDetailed.getJvmPoolOldGenUsed());
jvmGcDetailedBo.setSurvivorSpaceUsed(tJvmGcDetailed.getJvmPoolSurvivorSpaceUsed());
jvmGcDetailedBo.setPermGenUsed(tJvmGcDetailed.getJvmPoolPermGenUsed());
jvmGcDetailedBo.setMetaspaceUsed(tJvmGcDetailed.getJvmPoolMetaspaceUsed());
return jvmGcDetailedBo;
}
use of com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo in project pinpoint by naver.
the class AgentStatMapper method map.
@Override
public AgentStatBo map(TAgentStat tAgentStat) {
if (tAgentStat == null) {
return null;
}
final String agentId = tAgentStat.getAgentId();
final long startTimestamp = tAgentStat.getStartTimestamp();
final long timestamp = tAgentStat.getTimestamp();
AgentStatBo agentStatBo = new AgentStatBo();
agentStatBo.setAgentId(agentId);
// jvmGc
if (tAgentStat.isSetGc()) {
JvmGcBo jvmGcBo = this.jvmGcBoMapper.map(tAgentStat.getGc());
setBaseData(jvmGcBo, agentId, startTimestamp, timestamp);
agentStatBo.setJvmGcBos(Arrays.asList(jvmGcBo));
}
// jvmGcDetailed
if (tAgentStat.isSetGc()) {
if (tAgentStat.getGc().isSetJvmGcDetailed()) {
JvmGcDetailedBo jvmGcDetailedBo = this.jvmGcDetailedBoMapper.map(tAgentStat.getGc().getJvmGcDetailed());
setBaseData(jvmGcDetailedBo, agentId, startTimestamp, timestamp);
agentStatBo.setJvmGcDetailedBos(Arrays.asList(jvmGcDetailedBo));
}
}
// cpuLoad
if (tAgentStat.isSetCpuLoad()) {
CpuLoadBo cpuLoadBo = this.cpuLoadBoMapper.map(tAgentStat.getCpuLoad());
setBaseData(cpuLoadBo, agentId, startTimestamp, timestamp);
agentStatBo.setCpuLoadBos(Arrays.asList(cpuLoadBo));
}
// transaction
if (tAgentStat.isSetTransaction()) {
TransactionBo transactionBo = this.transactionBoMapper.map(tAgentStat.getTransaction());
setBaseData(transactionBo, agentId, startTimestamp, timestamp);
transactionBo.setCollectInterval(tAgentStat.getCollectInterval());
agentStatBo.setTransactionBos(Arrays.asList(transactionBo));
}
// activeTrace
if (tAgentStat.isSetActiveTrace() && tAgentStat.getActiveTrace().isSetHistogram()) {
ActiveTraceBo activeTraceBo = this.activeTraceBoMapper.map(tAgentStat.getActiveTrace());
setBaseData(activeTraceBo, agentId, startTimestamp, timestamp);
agentStatBo.setActiveTraceBos(Arrays.asList(activeTraceBo));
}
// datasource
if (tAgentStat.isSetDataSourceList()) {
DataSourceListBo dataSourceListBo = new DataSourceListBo();
setBaseData(dataSourceListBo, agentId, startTimestamp, timestamp);
TDataSourceList dataSourceList = tAgentStat.getDataSourceList();
for (TDataSource dataSource : dataSourceList.getDataSourceList()) {
DataSourceBo dataSourceBo = dataSourceBoMapper.map(dataSource);
setBaseData(dataSourceBo, agentId, startTimestamp, timestamp);
dataSourceListBo.add(dataSourceBo);
}
agentStatBo.setDataSourceListBos(Arrays.asList(dataSourceListBo));
}
return agentStatBo;
}
use of com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo 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;
}
use of com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo in project pinpoint by naver.
the class JvmGcDetailedCodecV2 method encodeValues.
@Override
public void encodeValues(Buffer valueBuffer, List<JvmGcDetailedBo> jvmGcDetailedBos) {
if (CollectionUtils.isEmpty(jvmGcDetailedBos)) {
throw new IllegalArgumentException("jvmGcDetailedBos must not be empty");
}
final int numValues = jvmGcDetailedBos.size();
valueBuffer.putVInt(numValues);
List<Long> startTimestamps = new ArrayList<Long>(numValues);
List<Long> timestamps = new ArrayList<Long>(numValues);
UnsignedLongEncodingStrategy.Analyzer.Builder gcNewCountAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
UnsignedLongEncodingStrategy.Analyzer.Builder gcNewTimeAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
UnsignedLongEncodingStrategy.Analyzer.Builder codeCacheUsedStrategyAnalyzer = new UnsignedLongEncodingStrategy.Analyzer.Builder();
UnsignedLongEncodingStrategy.Analyzer.Builder newGenUsedStrategyAnalyzer = new UnsignedLongEncodingStrategy.Analyzer.Builder();
UnsignedLongEncodingStrategy.Analyzer.Builder oldGenUsedStrategyAnalyzer = new UnsignedLongEncodingStrategy.Analyzer.Builder();
UnsignedLongEncodingStrategy.Analyzer.Builder survivorSpaceUsedStrategyAnalyzer = new UnsignedLongEncodingStrategy.Analyzer.Builder();
UnsignedLongEncodingStrategy.Analyzer.Builder permGenUsedStrategyAnalyzer = new UnsignedLongEncodingStrategy.Analyzer.Builder();
UnsignedLongEncodingStrategy.Analyzer.Builder metaspaceUsedStrategyAnalyzer = new UnsignedLongEncodingStrategy.Analyzer.Builder();
for (JvmGcDetailedBo jvmGcDetailedBo : jvmGcDetailedBos) {
startTimestamps.add(jvmGcDetailedBo.getStartTimestamp());
timestamps.add(jvmGcDetailedBo.getTimestamp());
gcNewCountAnalyzerBuilder.addValue(jvmGcDetailedBo.getGcNewCount());
gcNewTimeAnalyzerBuilder.addValue(jvmGcDetailedBo.getGcNewTime());
codeCacheUsedStrategyAnalyzer.addValue(AgentStatUtils.convertDoubleToLong(jvmGcDetailedBo.getCodeCacheUsed()));
newGenUsedStrategyAnalyzer.addValue(AgentStatUtils.convertDoubleToLong(jvmGcDetailedBo.getNewGenUsed()));
oldGenUsedStrategyAnalyzer.addValue(AgentStatUtils.convertDoubleToLong(jvmGcDetailedBo.getOldGenUsed()));
survivorSpaceUsedStrategyAnalyzer.addValue(AgentStatUtils.convertDoubleToLong(jvmGcDetailedBo.getSurvivorSpaceUsed()));
permGenUsedStrategyAnalyzer.addValue(AgentStatUtils.convertDoubleToLong(jvmGcDetailedBo.getPermGenUsed()));
metaspaceUsedStrategyAnalyzer.addValue(AgentStatUtils.convertDoubleToLong(jvmGcDetailedBo.getMetaspaceUsed()));
}
this.codec.encodeValues(valueBuffer, UnsignedLongEncodingStrategy.REPEAT_COUNT, startTimestamps);
this.codec.encodeTimestamps(valueBuffer, timestamps);
this.encodeDataPoints(valueBuffer, gcNewCountAnalyzerBuilder.build(), gcNewTimeAnalyzerBuilder.build(), codeCacheUsedStrategyAnalyzer.build(), newGenUsedStrategyAnalyzer.build(), oldGenUsedStrategyAnalyzer.build(), survivorSpaceUsedStrategyAnalyzer.build(), permGenUsedStrategyAnalyzer.build(), metaspaceUsedStrategyAnalyzer.build());
}
Aggregations