use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch in project pinpoint by naver.
the class TBaseFlatMapperTest method flatMap3Test.
@Test
public void flatMap3Test() throws Exception {
ApplicationCache applicationCache = newMockApplicationCache();
TBaseFlatMapper mapper = new TBaseFlatMapper(new JoinAgentStatBoMapper(), applicationCache, new DefaultTBaseFlatMapperInterceptor());
TFAgentStatBatch tfAgentStatBatch = createTFAgentStatBatch3();
ArrayList<Tuple3<String, JoinStatBo, Long>> dataList = new ArrayList<>();
ListCollector<Tuple3<String, JoinStatBo, Long>> collector = new ListCollector<>(dataList);
RawData rawData = newRawData(tfAgentStatBatch);
mapper.flatMap(rawData, collector);
assertEquals(dataList.size(), 2);
Tuple3<String, JoinStatBo, Long> data1 = dataList.get(0);
assertEquals(data1.f0, AGENT_ID);
assertEquals(data1.f2.longValue(), 1491274143454L);
JoinAgentStatBo joinAgentStatBo = (JoinAgentStatBo) data1.f1;
assertEquals(joinAgentStatBo.getId(), AGENT_ID);
assertEquals(joinAgentStatBo.getAgentStartTimestamp(), 1491274142454L);
assertEquals(joinAgentStatBo.getTimestamp(), 1491274143454L);
assertJoinTransactionBo(joinAgentStatBo.getJoinTransactionBoList());
Tuple3<String, JoinStatBo, Long> data2 = dataList.get(1);
assertEquals(data2.f0, APPLICATION_ID);
assertEquals(data2.f2.longValue(), 1491274140000L);
JoinApplicationStatBo joinApplicationStatBo = (JoinApplicationStatBo) data2.f1;
assertEquals(joinApplicationStatBo.getId(), APPLICATION_ID);
assertEquals(joinApplicationStatBo.getTimestamp(), 1491274140000L);
assertEquals(joinApplicationStatBo.getStatType(), StatType.APP_STST);
assertJoinTransactionBo(joinApplicationStatBo.getJoinTransactionBoList());
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch in project pinpoint by naver.
the class JoinAgentStatBoMapperTest method map5Test.
@Test
public void map5Test() {
final String agentId = "testAgent";
final JoinAgentStatBoMapper joinAgentStatBoMapper = new JoinAgentStatBoMapper();
final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
tFAgentStatBatch.setStartTimestamp(1491274138454L);
tFAgentStatBatch.setAgentId(agentId);
final TFResponseTime tFResponseTime = new TFResponseTime();
tFResponseTime.setAvg(100);
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId(agentId);
tFAgentStat.setTimestamp(1491274148454L);
tFAgentStat.setResponseTime(tFResponseTime);
final TFResponseTime tFResponseTime2 = new TFResponseTime();
tFResponseTime2.setAvg(120);
final TFAgentStat tFAgentStat2 = new TFAgentStat();
tFAgentStat2.setAgentId(agentId);
tFAgentStat2.setTimestamp(1491275148454L);
tFAgentStat2.setResponseTime(tFResponseTime2);
final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
tFAgentStatList.add(tFAgentStat);
tFAgentStatList.add(tFAgentStat2);
tFAgentStatBatch.setAgentStats(tFAgentStatList);
JoinAgentStatBo joinAgentStatBo = joinAgentStatBoMapper.map(tFAgentStatBatch);
assertEquals(joinAgentStatBo.getId(), agentId);
assertEquals(joinAgentStatBo.getAgentStartTimestamp(), 1491274138454L);
assertEquals(joinAgentStatBo.getTimestamp(), 1491274148454L);
List<JoinResponseTimeBo> joinResponseTimeBoList = joinAgentStatBo.getJoinResponseTimeBoList();
assertEquals(joinResponseTimeBoList.size(), 2);
JoinResponseTimeBo joinResponseTimeBo = joinResponseTimeBoList.get(0);
assertEquals(joinResponseTimeBo.getId(), agentId);
assertEquals(joinResponseTimeBo.getTimestamp(), 1491274148454L);
assertEquals(joinResponseTimeBo.getResponseTimeJoinValue(), new JoinLongFieldBo(100L, 100L, agentId, 100L, agentId));
JoinResponseTimeBo joinResponseTimeBo2 = joinResponseTimeBoList.get(1);
assertEquals(joinResponseTimeBo2.getId(), agentId);
assertEquals(joinResponseTimeBo2.getTimestamp(), 1491275148454L);
assertEquals(joinResponseTimeBo2.getResponseTimeJoinValue(), new JoinLongFieldBo(120L, 120L, agentId, 120L, agentId));
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch in project pinpoint by naver.
the class JoinAgentStatBoMapperTest method map6Test.
@Test
public void map6Test() {
final String agentId = "testAgent";
final JoinAgentStatBoMapper joinAgentStatBoMapper = new JoinAgentStatBoMapper();
final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
tFAgentStatBatch.setStartTimestamp(1491274138454L);
tFAgentStatBatch.setAgentId(agentId);
final TFTotalThreadCount tfTotalThreadCount = new TFTotalThreadCount();
tfTotalThreadCount.setTotalThreadCount(100);
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId(agentId);
tFAgentStat.setTimestamp(1491274148454L);
tFAgentStat.setTotalThreadCount(tfTotalThreadCount);
final TFTotalThreadCount tfTotalThreadCount2 = new TFTotalThreadCount();
tfTotalThreadCount2.setTotalThreadCount(120);
final TFAgentStat tFAgentStat2 = new TFAgentStat();
tFAgentStat2.setAgentId(agentId);
tFAgentStat2.setTimestamp(1491275148454L);
tFAgentStat2.setTotalThreadCount(tfTotalThreadCount2);
final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
tFAgentStatList.add(tFAgentStat);
tFAgentStatList.add(tFAgentStat2);
tFAgentStatBatch.setAgentStats(tFAgentStatList);
JoinAgentStatBo joinAgentStatBo = joinAgentStatBoMapper.map(tFAgentStatBatch);
assertEquals(agentId, joinAgentStatBo.getId());
assertEquals(1491274138454L, joinAgentStatBo.getAgentStartTimestamp());
assertEquals(1491274148454L, joinAgentStatBo.getTimestamp());
List<JoinTotalThreadCountBo> joinTotalThreadCountBoList = joinAgentStatBo.getJoinTotalThreadCountBoList();
assertEquals(joinTotalThreadCountBoList.size(), 2);
JoinTotalThreadCountBo joinTotalThreadCountBo = joinTotalThreadCountBoList.get(0);
assertEquals(agentId, joinTotalThreadCountBo.getId());
assertEquals(1491274148454L, joinTotalThreadCountBo.getTimestamp());
assertEquals(new JoinLongFieldBo(100L, 100L, agentId, 100L, agentId), joinTotalThreadCountBo.getTotalThreadCountJoinValue());
JoinTotalThreadCountBo joinTotalThreadCountBo2 = joinTotalThreadCountBoList.get(1);
assertEquals(agentId, joinTotalThreadCountBo2.getId());
assertEquals(1491275148454L, joinTotalThreadCountBo2.getTimestamp());
assertEquals(new JoinLongFieldBo(120L, 120L, agentId, 120L, agentId), joinTotalThreadCountBo2.getTotalThreadCountJoinValue());
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch in project pinpoint by naver.
the class JoinAgentStatBoMapperTest method map3Test.
@Test
public void map3Test() {
final String agentId = "testAgent";
final JoinAgentStatBoMapper joinAgentStatBoMapper = new JoinAgentStatBoMapper();
final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
tFAgentStatBatch.setStartTimestamp(1491274138454L);
tFAgentStatBatch.setAgentId(agentId);
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId(agentId);
tFAgentStat.setTimestamp(1491274148454L);
tFAgentStat.setCollectInterval(5000);
final TFTransaction tFTransaction = new TFTransaction();
tFTransaction.setSampledNewCount(10);
tFTransaction.setSampledContinuationCount(20);
tFTransaction.setUnsampledNewCount(40);
tFTransaction.setUnsampledContinuationCount(50);
tFAgentStat.setTransaction(tFTransaction);
final TFAgentStat tFAgentStat2 = new TFAgentStat();
tFAgentStat2.setAgentId(agentId);
tFAgentStat2.setTimestamp(1491275148454L);
tFAgentStat2.setCollectInterval(5000);
final TFTransaction tFTransaction2 = new TFTransaction();
tFTransaction2.setSampledNewCount(11);
tFTransaction2.setSampledContinuationCount(21);
tFTransaction2.setUnsampledNewCount(41);
tFTransaction2.setUnsampledContinuationCount(51);
tFAgentStat2.setTransaction(tFTransaction2);
final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
tFAgentStatList.add(tFAgentStat);
tFAgentStatList.add(tFAgentStat2);
tFAgentStatBatch.setAgentStats(tFAgentStatList);
JoinAgentStatBo joinAgentStatBo = joinAgentStatBoMapper.map(tFAgentStatBatch);
assertEquals(joinAgentStatBo.getId(), agentId);
assertEquals(joinAgentStatBo.getAgentStartTimestamp(), 1491274138454L);
assertEquals(joinAgentStatBo.getTimestamp(), 1491274148454L);
List<JoinTransactionBo> joinTransactionBoList = joinAgentStatBo.getJoinTransactionBoList();
assertEquals(joinTransactionBoList.size(), 2);
JoinTransactionBo joinTransactionBo = joinTransactionBoList.get(0);
assertEquals(joinTransactionBo.getId(), agentId);
assertEquals(joinTransactionBo.getTimestamp(), 1491274148454L);
assertEquals(joinTransactionBo.getCollectInterval(), 5000);
assertEquals(joinTransactionBo.getTotalCountJoinValue(), new JoinLongFieldBo(120L, 120L, agentId, 120L, agentId));
JoinTransactionBo joinTransactionBo2 = joinTransactionBoList.get(1);
assertEquals(joinTransactionBo2.getId(), agentId);
assertEquals(joinTransactionBo2.getTimestamp(), 1491275148454L);
assertEquals(joinTransactionBo2.getCollectInterval(), 5000);
assertEquals(joinTransactionBo2.getTotalCountJoinValue(), new JoinLongFieldBo(124L, 124L, agentId, 124L, agentId));
}
use of com.navercorp.pinpoint.thrift.dto.flink.TFAgentStatBatch in project pinpoint by naver.
the class JoinAgentStatBoMapperTest method map7Test.
@Test
public void map7Test() {
final String agentId = "testAgent";
final JoinAgentStatBoMapper joinAgentStatBoMapper = new JoinAgentStatBoMapper();
final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch();
tFAgentStatBatch.setStartTimestamp(1491274138454L);
tFAgentStatBatch.setAgentId(agentId);
final TFLoadedClass tfLoadedClass = new TFLoadedClass();
tfLoadedClass.setLoadedClassCount(100);
tfLoadedClass.setUnloadedClassCount(100);
final TFAgentStat tFAgentStat = new TFAgentStat();
tFAgentStat.setAgentId(agentId);
tFAgentStat.setTimestamp(1491274148454L);
tFAgentStat.setLoadedClass(tfLoadedClass);
final TFLoadedClass tfLoadedClass2 = new TFLoadedClass();
tfLoadedClass2.setLoadedClassCount(120);
tfLoadedClass2.setUnloadedClassCount(120);
final TFAgentStat tFAgentStat2 = new TFAgentStat();
tFAgentStat2.setAgentId(agentId);
tFAgentStat2.setTimestamp(1491275148454L);
tFAgentStat2.setLoadedClass(tfLoadedClass2);
final List<TFAgentStat> tFAgentStatList = new ArrayList<>(2);
tFAgentStatList.add(tFAgentStat);
tFAgentStatList.add(tFAgentStat2);
tFAgentStatBatch.setAgentStats(tFAgentStatList);
JoinAgentStatBo joinAgentStatBo = joinAgentStatBoMapper.map(tFAgentStatBatch);
assertEquals(agentId, joinAgentStatBo.getId());
assertEquals(1491274138454L, joinAgentStatBo.getAgentStartTimestamp());
assertEquals(1491274148454L, joinAgentStatBo.getTimestamp());
List<JoinLoadedClassBo> joinLoadedClassBoList = joinAgentStatBo.getJoinLoadedClassBoList();
assertEquals(joinLoadedClassBoList.size(), 2);
JoinLoadedClassBo joinLoadedClassBo = joinLoadedClassBoList.get(0);
assertEquals(agentId, joinLoadedClassBo.getId());
assertEquals(1491274148454L, joinLoadedClassBo.getTimestamp());
assertEquals(new JoinLongFieldBo(100L, 100L, agentId, 100L, agentId), joinLoadedClassBo.getLoadedClassJoinValue());
assertEquals(new JoinLongFieldBo(100L, 100L, agentId, 100L, agentId), joinLoadedClassBo.getUnloadedClassJoinValue());
JoinLoadedClassBo joinLoadedClassBo2 = joinLoadedClassBoList.get(1);
assertEquals(agentId, joinLoadedClassBo2.getId());
assertEquals(1491275148454L, joinLoadedClassBo2.getTimestamp());
assertEquals(new JoinLongFieldBo(120L, 120L, agentId, 120L, agentId), joinLoadedClassBo2.getLoadedClassJoinValue());
assertEquals(new JoinLongFieldBo(120L, 120L, agentId, 120L, agentId), joinLoadedClassBo2.getUnloadedClassJoinValue());
}
Aggregations