use of com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSource in project pinpoint by naver.
the class StatThriftMessageConverter method convertDataSourceList.
private TDataSourceList convertDataSourceList(DataSourceMetricSnapshot dataSourceMetricSnapshot) {
final TDataSourceList dataSourceList = new TDataSourceList();
for (DataSource dataSourceCollectData : dataSourceMetricSnapshot.getDataSourceList()) {
final TDataSource dataSource = new TDataSource(dataSourceCollectData.getId());
dataSource.setServiceTypeCode(dataSourceCollectData.getServiceTypeCode());
if (dataSourceCollectData.getDatabaseName() != null) {
dataSource.setDatabaseName(dataSourceCollectData.getDatabaseName());
}
if (dataSourceCollectData.getActiveConnectionSize() != 0) {
dataSource.setActiveConnectionSize(dataSourceCollectData.getActiveConnectionSize());
}
if (dataSourceCollectData.getUrl() != null) {
dataSource.setUrl(dataSourceCollectData.getUrl());
}
dataSource.setMaxConnectionSize(dataSourceCollectData.getMaxConnectionSize());
dataSourceList.addToDataSourceList(dataSource);
}
return dataSourceList;
}
use of com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSource 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();
}
use of com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSource in project pinpoint by naver.
the class DefaultDataSourceMetricCollector method collect.
@Override
public DataSourceMetricSnapshot collect() {
final List<DataSource> dataSources = dataSourceMetric.dataSourceList();
if (CollectionUtils.isEmpty(dataSources)) {
return new DataSourceMetricSnapshot();
}
final DataSourceMetricSnapshot dataSourceMetricSnapshot = new DataSourceMetricSnapshot();
for (DataSource dataSource : dataSources) {
dataSourceMetricSnapshot.addDataSourceCollectData(dataSource);
}
return dataSourceMetricSnapshot;
}
Aggregations