use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class AgentStatHandlerV2 method handleAgentStat.
private void handleAgentStat(TAgentStat tAgentStat) {
if (logger.isDebugEnabled()) {
logger.debug("Received TAgentStat={}", tAgentStat);
}
AgentStatBo agentStatBo = this.agentStatMapper.map(tAgentStat);
this.insertAgentStatBatch(agentStatBo);
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo 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.AgentStatBo in project pinpoint by naver.
the class AgentStatHandlerV2Test method insertShouldNotBeCalledIfTAgentStatBatchIsMappedToNull.
@Test
public void insertShouldNotBeCalledIfTAgentStatBatchIsMappedToNull() {
// Given
final int numBatches = 6;
final String agentId = "agentId";
final long startTimestamp = Long.MAX_VALUE;
final TAgentStatBatch agentStatBatch = createAgentStatBatch(agentId, startTimestamp, numBatches);
final AgentStatBo mappedAgentStat = null;
when(this.agentStatBatchMapper.map(agentStatBatch)).thenReturn(mappedAgentStat);
// When
agentStatHandler.handle(agentStatBatch);
// Then
verifyZeroInteractions(jvmGcDao);
verifyZeroInteractions(jvmGcDetailedDao);
verifyZeroInteractions(cpuLoadDao);
verifyZeroInteractions(transactionDao);
verifyZeroInteractions(activeTraceDao);
verifyZeroInteractions(dataSourceDao);
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class TFCpuLoadMapper method build.
@Override
public void build(TFAgentStatMapper.TFAgentStatBuilder builder) {
AgentStatBo agentStat = builder.getAgentStat();
List<CpuLoadBo> cpuLoadList = agentStat.getCpuLoadBos();
builder.build(cpuLoadList, this);
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo in project pinpoint by naver.
the class TFFileDescriptorMapper method build.
@Override
public void build(TFAgentStatMapper.TFAgentStatBuilder builder) {
AgentStatBo agentStat = builder.getAgentStat();
List<FileDescriptorBo> fileDescriptorList = agentStat.getFileDescriptorBos();
builder.build(fileDescriptorList, this);
}
Aggregations