use of com.navercorp.pinpoint.grpc.trace.PDataSourceList in project pinpoint by naver.
the class GrpcDataSourceBoMapper method map.
@Override
public void map(AgentStatBo.Builder.StatBuilder builder, PAgentStat agentStat) {
// datasource
if (agentStat.hasDataSourceList()) {
final PDataSourceList dataSourceList = agentStat.getDataSourceList();
final DataSourceListBo dataSourceListBo = new DataSourceListBo();
for (PDataSource dataSource : dataSourceList.getDataSourceList()) {
final DataSourceBo dataSourceBo = this.map(dataSource);
dataSourceListBo.add(dataSourceBo);
}
builder.addDataSourceList(dataSourceListBo);
}
}
use of com.navercorp.pinpoint.grpc.trace.PDataSourceList in project pinpoint by naver.
the class GrpcStatMessageConverter method converAgentStat.
private PAgentStat converAgentStat(final AgentStatMetricSnapshot agentStatMetricSnapshot) {
final PAgentStat.Builder agentStatBuilder = PAgentStat.newBuilder();
agentStatBuilder.setTimestamp(agentStatMetricSnapshot.getTimestamp());
agentStatBuilder.setCollectInterval(agentStatMetricSnapshot.getCollectInterval());
// Skip agent information(agentId, startTimestamp)
// Metric
final JvmGcMetricSnapshot jvmGcMetricSnapshot = agentStatMetricSnapshot.getGc();
if (jvmGcMetricSnapshot != null) {
final PJvmGc jvmGc = convertJvmGc(jvmGcMetricSnapshot);
agentStatBuilder.setGc(jvmGc);
}
final CpuLoadMetricSnapshot cpuLoadMetricSnapshot = agentStatMetricSnapshot.getCpuLoad();
if (cpuLoadMetricSnapshot != null) {
final PCpuLoad cpuLoad = convertCpuLoad(cpuLoadMetricSnapshot);
agentStatBuilder.setCpuLoad(cpuLoad);
}
final TransactionMetricSnapshot transactionMetricSnapshot = agentStatMetricSnapshot.getTransaction();
if (transactionMetricSnapshot != null) {
final PTransaction transaction = convertTransaction(transactionMetricSnapshot);
agentStatBuilder.setTransaction(transaction);
}
final ActiveTraceHistogram activeTraceHistogram = agentStatMetricSnapshot.getActiveTrace();
if (activeTraceHistogram != null) {
final PActiveTrace activeTrace = convertActiveTrace(activeTraceHistogram);
agentStatBuilder.setActiveTrace(activeTrace);
}
final DataSourceMetricSnapshot dataSourceMetricSnapshot = agentStatMetricSnapshot.getDataSourceList();
if (dataSourceMetricSnapshot != null) {
final PDataSourceList dataSourceList = convertDataSourceList(dataSourceMetricSnapshot);
agentStatBuilder.setDataSourceList(dataSourceList);
}
final ResponseTimeValue responseTimeValue = agentStatMetricSnapshot.getResponseTime();
if (responseTimeValue != null) {
final PResponseTime responseTime = convertResponseTime(responseTimeValue);
agentStatBuilder.setResponseTime(responseTime);
}
final DeadlockMetricSnapshot deadlockMetricSnapshot = agentStatMetricSnapshot.getDeadlock();
if (deadlockMetricSnapshot != null) {
final PDeadlock deadlock = convertDeadlock(deadlockMetricSnapshot);
agentStatBuilder.setDeadlock(deadlock);
}
final FileDescriptorMetricSnapshot fileDescriptorMetricSnapshot = agentStatMetricSnapshot.getFileDescriptor();
if (fileDescriptorMetricSnapshot != null) {
final PFileDescriptor fileDescriptor = convertFileDescriptor(fileDescriptorMetricSnapshot);
agentStatBuilder.setFileDescriptor(fileDescriptor);
}
final BufferMetricSnapshot bufferMetricSnapshot = agentStatMetricSnapshot.getDirectBuffer();
if (bufferMetricSnapshot != null) {
final PDirectBuffer directBuffer = convertDirectBuffer(bufferMetricSnapshot);
agentStatBuilder.setDirectBuffer(directBuffer);
}
final TotalThreadMetricSnapshot totalThreadMetricSnapshot = agentStatMetricSnapshot.getTotalThread();
if (totalThreadMetricSnapshot != null) {
final PTotalThread totalThread = convertTotalThread(totalThreadMetricSnapshot);
agentStatBuilder.setTotalThread(totalThread);
}
final LoadedClassMetricSnapshot loadedClassMetricSnapshot = agentStatMetricSnapshot.getLoadedClassCount();
if (loadedClassMetricSnapshot != null) {
final PLoadedClass loadedClass = convertLoadedClass(loadedClassMetricSnapshot);
agentStatBuilder.setLoadedClass(loadedClass);
}
return agentStatBuilder.build();
}
use of com.navercorp.pinpoint.grpc.trace.PDataSourceList in project pinpoint by naver.
the class GrpcStatMessageConverter method convertDataSourceList.
private PDataSourceList convertDataSourceList(DataSourceMetricSnapshot dataSourceMetricSnapshot) {
final PDataSourceList.Builder dataSourceListBuilder = PDataSourceList.newBuilder();
for (DataSource dataSourceCollectData : dataSourceMetricSnapshot.getDataSourceList()) {
PDataSource.Builder dataSourceBuilder = PDataSource.newBuilder();
dataSourceBuilder.setId(dataSourceCollectData.getId());
dataSourceBuilder.setServiceTypeCode(dataSourceCollectData.getServiceTypeCode());
if (dataSourceCollectData.getDatabaseName() != null) {
dataSourceBuilder.setDatabaseName(dataSourceCollectData.getDatabaseName());
}
if (dataSourceCollectData.getActiveConnectionSize() != 0) {
dataSourceBuilder.setActiveConnectionSize(dataSourceCollectData.getActiveConnectionSize());
}
if (dataSourceCollectData.getUrl() != null) {
dataSourceBuilder.setUrl(dataSourceCollectData.getUrl());
}
dataSourceBuilder.setMaxConnectionSize(dataSourceCollectData.getMaxConnectionSize());
dataSourceListBuilder.addDataSource(dataSourceBuilder.build());
}
return dataSourceListBuilder.build();
}
Aggregations