use of com.navercorp.pinpoint.common.server.bo.stat.TransactionBo in project pinpoint by naver.
the class HbaseSampledTransactionDao method getSampledAgentStatList.
@Override
public List<SampledTransaction> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
long scanFrom = timeWindow.getWindowRange().getFrom();
long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
Range range = new Range(scanFrom, scanTo);
SampledAgentStatResultExtractor<TransactionBo, SampledTransaction> resultExtractor = new SampledAgentStatResultExtractor<>(timeWindow, mapper, transactionSampler);
return operations.getSampledAgentStatList(resultExtractor, agentId, range);
}
use of com.navercorp.pinpoint.common.server.bo.stat.TransactionBo 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.TransactionBo in project pinpoint by naver.
the class TransactionBoMapper method map.
@Override
public TransactionBo map(TTransaction tTransaction) {
TransactionBo transaction = new TransactionBo();
transaction.setSampledNewCount(tTransaction.getSampledNewCount());
transaction.setSampledContinuationCount(tTransaction.getSampledContinuationCount());
transaction.setUnsampledNewCount(tTransaction.getUnsampledNewCount());
transaction.setUnsampledContinuationCount(tTransaction.getUnsampledContinuationCount());
return transaction;
}
use of com.navercorp.pinpoint.common.server.bo.stat.TransactionBo in project pinpoint by naver.
the class TransactionCodecV1 method encodeValues.
@Override
public void encodeValues(Buffer valueBuffer, List<TransactionBo> transactionBos) {
if (CollectionUtils.isEmpty(transactionBos)) {
throw new IllegalArgumentException("transactionBos must not be empty");
}
final int numValues = transactionBos.size();
valueBuffer.putVInt(numValues);
List<Long> timestamps = new ArrayList<Long>(numValues);
UnsignedLongEncodingStrategy.Analyzer.Builder collectIntervalAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
UnsignedLongEncodingStrategy.Analyzer.Builder sampledNewCountAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
UnsignedLongEncodingStrategy.Analyzer.Builder sampledContinuationCountAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
UnsignedLongEncodingStrategy.Analyzer.Builder unsampledNewCountAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
UnsignedLongEncodingStrategy.Analyzer.Builder unsampledContinuationCountAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder();
for (TransactionBo transactionBo : transactionBos) {
timestamps.add(transactionBo.getTimestamp());
collectIntervalAnalyzerBuilder.addValue(transactionBo.getCollectInterval());
sampledNewCountAnalyzerBuilder.addValue(transactionBo.getSampledNewCount());
sampledContinuationCountAnalyzerBuilder.addValue(transactionBo.getSampledContinuationCount());
unsampledNewCountAnalyzerBuilder.addValue(transactionBo.getUnsampledNewCount());
unsampledContinuationCountAnalyzerBuilder.addValue(transactionBo.getUnsampledContinuationCount());
}
this.codec.encodeTimestamps(valueBuffer, timestamps);
this.encodeDataPoints(valueBuffer, collectIntervalAnalyzerBuilder.build(), sampledNewCountAnalyzerBuilder.build(), sampledContinuationCountAnalyzerBuilder.build(), unsampledNewCountAnalyzerBuilder.build(), unsampledContinuationCountAnalyzerBuilder.build());
}
use of com.navercorp.pinpoint.common.server.bo.stat.TransactionBo in project pinpoint by naver.
the class TransactionCodecV2 method decodeValues.
@Override
public List<TransactionBo> 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> collectIntervalEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Long> sampledNewCountEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Long> sampledContinuationCountEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Long> unsampledNewCountEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Long> unsampledContinuationCountEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
// decode values
List<Long> collectIntervals = this.codec.decodeValues(valueBuffer, collectIntervalEncodingStrategy, numValues);
List<Long> sampledNewCounts = this.codec.decodeValues(valueBuffer, sampledNewCountEncodingStrategy, numValues);
List<Long> sampledContinuationCounts = this.codec.decodeValues(valueBuffer, sampledContinuationCountEncodingStrategy, numValues);
List<Long> unsampledNewCounts = this.codec.decodeValues(valueBuffer, unsampledNewCountEncodingStrategy, numValues);
List<Long> unsampledContinuationCounts = this.codec.decodeValues(valueBuffer, unsampledContinuationCountEncodingStrategy, numValues);
List<TransactionBo> transactionBos = new ArrayList<TransactionBo>(numValues);
for (int i = 0; i < numValues; ++i) {
TransactionBo transactionBo = new TransactionBo();
transactionBo.setAgentId(agentId);
transactionBo.setStartTimestamp(startTimestamps.get(i));
transactionBo.setTimestamp(timestamps.get(i));
transactionBo.setCollectInterval(collectIntervals.get(i));
transactionBo.setSampledNewCount(sampledNewCounts.get(i));
transactionBo.setSampledContinuationCount(sampledContinuationCounts.get(i));
transactionBo.setUnsampledNewCount(unsampledNewCounts.get(i));
transactionBo.setUnsampledContinuationCount(unsampledContinuationCounts.get(i));
transactionBos.add(transactionBo);
}
return transactionBos;
}
Aggregations