use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class GrpcAgentStatHandlerV2 method handleAgentStatBatch.
private void handleAgentStatBatch(PAgentStatBatch agentStatBatch) {
if (isDebug) {
logger.debug("Handle PAgentStatBatch={}", MessageFormatUtils.debugLog(agentStatBatch));
}
Header header = ServerContext.getAgentInfo();
final AgentStatBo agentStatBo = this.agentStatBatchMapper.map(agentStatBatch, header);
if (agentStatBo == null) {
return;
}
for (AgentStatService agentStatService : agentStatServiceList) {
try {
agentStatService.save(agentStatBo);
} catch (Exception e) {
logger.warn("Failed to handle service={}, AgentStatBatch={}", agentStatService, MessageFormatUtils.debugLog(agentStatBatch), e);
}
}
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class TFAgentStatMapperTest method createTotalThreadCountBoList.
private AgentStatBo createTotalThreadCountBoList() {
AgentStatBo.Builder builder = newBuilder();
TotalThreadCountBo totalThreadCountBo1 = new TotalThreadCountBo();
totalThreadCountBo1.setAgentId(TEST_AGENT);
totalThreadCountBo1.setTimestamp(collectTime1st);
totalThreadCountBo1.setStartTimestamp(startTimestamp);
totalThreadCountBo1.setTotalThreadCount(4);
AgentStatBo.Builder.StatBuilder statBuilder1 = builder.newStatBuilder(collectTime1st);
statBuilder1.addTotalThreadCount(totalThreadCountBo1);
TotalThreadCountBo totalThreadCountBo2 = new TotalThreadCountBo();
totalThreadCountBo2.setTotalThreadCount(5);
AgentStatBo.Builder.StatBuilder statBuilder2 = builder.newStatBuilder(collectTime2nd);
statBuilder2.addTotalThreadCount(totalThreadCountBo2);
TotalThreadCountBo totalThreadCountBo3 = new TotalThreadCountBo();
totalThreadCountBo3.setTotalThreadCount(8);
AgentStatBo.Builder.StatBuilder statBuilder3 = builder.newStatBuilder(collectTime3rd);
statBuilder3.addTotalThreadCount(totalThreadCountBo3);
return builder.build();
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class TFAgentStatMapperTest method map8Test.
@Test
public void map8Test() {
AgentStatBo agentStatBo = createLoadedClassCountBoList();
List<TFAgentStat> tFAgentStatList = newAgentStatMapper().map(agentStatBo);
assertEquals(3, tFAgentStatList.size());
TFAgentStat tFAgentStat1 = tFAgentStatList.get(0);
assertEquals(TEST_AGENT, tFAgentStat1.getAgentId());
assertEquals(startTimestamp, tFAgentStat1.getStartTimestamp());
assertEquals(collectTime1st, tFAgentStat1.getTimestamp());
assertEquals(4, tFAgentStat1.getLoadedClass().getLoadedClassCount(), 0);
assertEquals(4, tFAgentStat1.getLoadedClass().getUnloadedClassCount(), 0);
TFAgentStat tFAgentStat2 = tFAgentStatList.get(1);
assertEquals(TEST_AGENT, tFAgentStat2.getAgentId());
assertEquals(startTimestamp, tFAgentStat2.getStartTimestamp());
assertEquals(collectTime2nd, tFAgentStat2.getTimestamp());
assertEquals(5, tFAgentStat2.getLoadedClass().getLoadedClassCount(), 0);
assertEquals(5, tFAgentStat2.getLoadedClass().getUnloadedClassCount(), 0);
TFAgentStat tFAgentStat3 = tFAgentStatList.get(2);
assertEquals(TEST_AGENT, tFAgentStat3.getAgentId());
assertEquals(startTimestamp, tFAgentStat3.getStartTimestamp());
assertEquals(collectTime3rd, tFAgentStat3.getTimestamp());
assertEquals(6, tFAgentStat3.getLoadedClass().getLoadedClassCount(), 0);
assertEquals(6, tFAgentStat3.getLoadedClass().getUnloadedClassCount(), 0);
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class TFAgentStatMapperTest method map6Test.
@Test
public void map6Test() {
AgentStatBo agentStatBo = createFileDescriptorBoList();
List<TFAgentStat> tFAgentStatList = newAgentStatMapper().map(agentStatBo);
assertEquals(3, tFAgentStatList.size());
TFAgentStat tFAgentStat1 = tFAgentStatList.get(0);
assertEquals(TEST_AGENT, tFAgentStat1.getAgentId());
assertEquals(startTimestamp, tFAgentStat1.getStartTimestamp());
assertEquals(collectTime1st, tFAgentStat1.getTimestamp());
assertEquals(4, tFAgentStat1.getFileDescriptor().getOpenFileDescriptorCount(), 0);
TFAgentStat tFAgentStat2 = tFAgentStatList.get(1);
assertEquals(TEST_AGENT, tFAgentStat2.getAgentId());
assertEquals(startTimestamp, tFAgentStat2.getStartTimestamp());
assertEquals(collectTime2nd, tFAgentStat2.getTimestamp());
assertEquals(5, tFAgentStat2.getFileDescriptor().getOpenFileDescriptorCount(), 0);
TFAgentStat tFAgentStat3 = tFAgentStatList.get(2);
assertEquals(TEST_AGENT, tFAgentStat3.getAgentId());
assertEquals(startTimestamp, tFAgentStat3.getStartTimestamp());
assertEquals(collectTime3rd, tFAgentStat3.getTimestamp());
assertEquals(8, tFAgentStat3.getFileDescriptor().getOpenFileDescriptorCount(), 0);
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class TFAgentStatMapperTest method createActiveTraceBoList.
private AgentStatBo createActiveTraceBoList() {
AgentStatBo.Builder builder = newBuilder();
ActiveTraceBo activeTraceBo1 = new ActiveTraceBo();
activeTraceBo1.setVersion((short) 1);
activeTraceBo1.setHistogramSchemaType(2);
ActiveTraceHistogram activeTraceHistogram1 = new ActiveTraceHistogram(30, 40, 10, 50);
activeTraceBo1.setActiveTraceHistogram(activeTraceHistogram1);
AgentStatBo.Builder.StatBuilder statBuilder1 = builder.newStatBuilder(collectTime1st);
statBuilder1.addActiveTrace(activeTraceBo1);
ActiveTraceBo activeTraceBo2 = new ActiveTraceBo();
activeTraceBo2.setTimestamp(collectTime2nd);
activeTraceBo2.setVersion((short) 1);
activeTraceBo2.setHistogramSchemaType(2);
ActiveTraceHistogram activeTraceHistogram2 = new ActiveTraceHistogram(31, 41, 11, 51);
activeTraceBo2.setActiveTraceHistogram(activeTraceHistogram2);
AgentStatBo.Builder.StatBuilder statBuilder2 = builder.newStatBuilder(collectTime2nd);
statBuilder2.addActiveTrace(activeTraceBo2);
return builder.build();
}
Aggregations