Search in sources :

Example 1 with DataSource

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;
}
Also used : TDataSourceList(com.navercorp.pinpoint.thrift.dto.TDataSourceList) TDataSource(com.navercorp.pinpoint.thrift.dto.TDataSource) DataSource(com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSource) TDataSource(com.navercorp.pinpoint.thrift.dto.TDataSource)

Example 2 with DataSource

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();
}
Also used : PDataSourceList(com.navercorp.pinpoint.grpc.trace.PDataSourceList) PDataSource(com.navercorp.pinpoint.grpc.trace.PDataSource) DataSource(com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSource) PDataSource(com.navercorp.pinpoint.grpc.trace.PDataSource)

Example 3 with DataSource

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;
}
Also used : DataSourceMetricSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSourceMetricSnapshot) DataSource(com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSource)

Aggregations

DataSource (com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSource)3 PDataSource (com.navercorp.pinpoint.grpc.trace.PDataSource)1 PDataSourceList (com.navercorp.pinpoint.grpc.trace.PDataSourceList)1 DataSourceMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.datasource.DataSourceMetricSnapshot)1 TDataSource (com.navercorp.pinpoint.thrift.dto.TDataSource)1 TDataSourceList (com.navercorp.pinpoint.thrift.dto.TDataSourceList)1