use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.
the class TransactionCodec 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);
// decode headers
final byte[] header = valueBuffer.readPrefixedBytes();
AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
EncodingStrategy<Long> collectIntervalEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode());
JoinLongFieldEncodingStrategy totalCountEncodingStrategy = JoinLongFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode());
List<Long> collectIntervalList = this.codec.decodeValues(valueBuffer, collectIntervalEncodingStrategy, numValues);
final List<JoinLongFieldBo> totalCountList = this.codec.decodeValues(valueBuffer, totalCountEncodingStrategy, numValues);
List<JoinStatBo> joinTransactionBoList = new ArrayList<>();
for (int i = 0; i < numValues; i++) {
JoinTransactionBo joinTransactionBo = new JoinTransactionBo();
joinTransactionBo.setId(id);
joinTransactionBo.setTimestamp(timestampList.get(i));
joinTransactionBo.setCollectInterval(collectIntervalList.get(i));
joinTransactionBo.setTotalCountJoinValue(totalCountList.get(i));
joinTransactionBoList.add(joinTransactionBo);
}
return joinTransactionBoList;
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.
the class JoinDirectBufferBoMapperTest method mapTest.
@Test
public void mapTest() throws Exception {
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId("testAgent");
tFAgentStat.setTimestamp(1491274138454L);
final TFDirectBuffer tfDirectBuffer = new TFDirectBuffer();
tfDirectBuffer.setDirectCount(10);
tfDirectBuffer.setDirectMemoryUsed(11);
tfDirectBuffer.setMappedCount(12);
tfDirectBuffer.setMappedMemoryUsed(13);
tFAgentStat.setDirectBuffer(tfDirectBuffer);
final JoinDirectBufferBoMapper mapper = new JoinDirectBufferBoMapper();
final JoinDirectBufferBo joinDirectBufferBo = mapper.map(tFAgentStat);
assertNotNull(joinDirectBufferBo);
assertEquals(joinDirectBufferBo.getId(), "testAgent");
assertEquals(joinDirectBufferBo.getTimestamp(), 1491274138454L);
final JoinLongFieldBo directCountJoinValue = joinDirectBufferBo.getDirectCountJoinValue();
assertEquals(directCountJoinValue.getAvg(), 10, 0);
assertEquals(directCountJoinValue.getMin(), 10, 0);
assertEquals(directCountJoinValue.getMax(), 10, 0);
final JoinLongFieldBo directMemoryUsedJoinValue = joinDirectBufferBo.getDirectMemoryUsedJoinValue();
assertEquals(directMemoryUsedJoinValue.getAvg(), 11, 0);
assertEquals(directMemoryUsedJoinValue.getMin(), 11, 0);
assertEquals(directMemoryUsedJoinValue.getMax(), 11, 0);
final JoinLongFieldBo mappedCountJoinValue = joinDirectBufferBo.getMappedCountJoinValue();
assertEquals(mappedCountJoinValue.getAvg(), 12, 0);
assertEquals(mappedCountJoinValue.getMin(), 12, 0);
assertEquals(mappedCountJoinValue.getMax(), 12, 0);
final JoinLongFieldBo mappedMemoryUsedJoinValue = joinDirectBufferBo.getMappedMemoryUsedJoinValue();
assertEquals(mappedMemoryUsedJoinValue.getAvg(), 13, 0);
assertEquals(mappedMemoryUsedJoinValue.getMin(), 13, 0);
assertEquals(mappedMemoryUsedJoinValue.getMax(), 13, 0);
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.
the class JoinResponseTimeBoMapperTest method mapTest.
@Test
public void mapTest() {
final String agentId = "agentId";
final TFResponseTime tFResponseTime = new TFResponseTime();
tFResponseTime.setAvg(100);
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId(agentId);
tFAgentStat.setTimestamp(1491274148454L);
tFAgentStat.setResponseTime(tFResponseTime);
JoinResponseTimeBoMapper mapper = new JoinResponseTimeBoMapper();
JoinResponseTimeBo joinResponseTimeBo = mapper.map(tFAgentStat);
assertEquals(joinResponseTimeBo.getId(), agentId);
assertEquals(joinResponseTimeBo.getTimestamp(), 1491274148454L);
assertEquals(joinResponseTimeBo.getResponseTimeJoinValue(), new JoinLongFieldBo(100L, 100L, agentId, 100L, agentId));
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.
the class JoinTransactionBoMapperTest method mapTest.
@Test
public void mapTest() throws Exception {
final TFAgentStat tFAgentStat = new TFAgentStat();
final String id = "testAgent";
tFAgentStat.setAgentId(id);
tFAgentStat.setTimestamp(1491274138454L);
tFAgentStat.setCollectInterval(5000);
final TFTransaction tFTransaction = new TFTransaction();
tFTransaction.setSampledNewCount(10);
tFTransaction.setSampledContinuationCount(20);
tFTransaction.setUnsampledNewCount(40);
tFTransaction.setUnsampledContinuationCount(50);
tFTransaction.setSkippedNewCount(60);
tFTransaction.setSkippedContinuationCount(70);
tFAgentStat.setTransaction(tFTransaction);
final JoinTransactionBoMapper joinTransactionBoMapper = new JoinTransactionBoMapper();
final JoinTransactionBo joinTransactionBo = joinTransactionBoMapper.map(tFAgentStat);
assertNotNull(joinTransactionBo);
assertEquals(joinTransactionBo.getId(), id);
assertEquals(joinTransactionBo.getTimestamp(), 1491274138454L);
assertEquals(joinTransactionBo.getCollectInterval(), 5000);
assertEquals(joinTransactionBo.getTotalCountJoinValue(), new JoinLongFieldBo(250L, 250L, id, 250L, id));
}
use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinLongFieldBo in project pinpoint by naver.
the class JoinTotalThreadCountBoMapperTest method mapTest.
@Test
public void mapTest() throws Exception {
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId("testAgent");
tFAgentStat.setTimestamp(1491274138454L);
final TFTotalThreadCount tfTotalThreadCount = new TFTotalThreadCount();
tfTotalThreadCount.setTotalThreadCount(50);
tFAgentStat.setTotalThreadCount(tfTotalThreadCount);
final JoinTotalThreadCountBoMapper mapper = new JoinTotalThreadCountBoMapper();
final JoinTotalThreadCountBo joinTotalThreadCountBo = mapper.map(tFAgentStat);
assertNotNull(joinTotalThreadCountBo);
assertEquals(joinTotalThreadCountBo.getId(), "testAgent");
assertEquals(joinTotalThreadCountBo.getTimestamp(), 1491274138454L);
assertEquals(joinTotalThreadCountBo.getTotalThreadCountJoinValue(), new JoinLongFieldBo(50L, 50L, "testAgent", 50L, "testAgent"));
}
Aggregations