Search in sources :

Example 6 with DataSourceListBo

use of com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo in project pinpoint by naver.

the class DataSourceCodecV2 method encodeValues.

@Override
public void encodeValues(Buffer valueBuffer, List<DataSourceListBo> dataSourceListBos) {
    if (CollectionUtils.isEmpty(dataSourceListBos)) {
        throw new IllegalArgumentException("dataSourceListBos must not be empty");
    }
    final int numValues = dataSourceListBos.size();
    valueBuffer.putVInt(numValues);
    for (DataSourceListBo dataSourceListBo : dataSourceListBos) {
        encodeDataSourceListBo(valueBuffer, dataSourceListBo);
    }
}
Also used : DataSourceListBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo)

Example 7 with DataSourceListBo

use of com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo in project pinpoint by naver.

the class DataSourceCodecV2 method decodeValues.

@Override
public List<DataSourceListBo> decodeValues(Buffer valueBuffer, AgentStatDecodingContext decodingContext) {
    int numValues = valueBuffer.readVInt();
    List<DataSourceListBo> dataSourceListBos = new ArrayList<DataSourceListBo>(numValues);
    for (int i = 0; i < numValues; i++) {
        DataSourceListBo dataSourceListBo = decodeValue(valueBuffer, decodingContext);
        dataSourceListBos.add(dataSourceListBo);
    }
    return dataSourceListBos;
}
Also used : ArrayList(java.util.ArrayList) DataSourceListBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo)

Example 8 with DataSourceListBo

use of com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo in project pinpoint by naver.

the class TestAgentStatFactory method createDataSourceListBos.

public static List<DataSourceListBo> createDataSourceListBos(String agentId, long startTimestamp, long initialTimestamp, int numValues) {
    List<DataSourceListBo> dataSourceListBos = new ArrayList<DataSourceListBo>(numValues);
    for (int i = 0; i < numValues; ++i) {
        int maxConnectionSize = RANDOM.nextInt(MIN_VALUE_OF_MAX_CONNECTION_SIZE) + MIN_VALUE_OF_MAX_CONNECTION_SIZE;
        int dataSourceBoSize = RANDOM.nextInt(MAX_NUM_TEST_VALUES) + 1;
        DataSourceListBo dataSourceListBo = createDataSourceListBo(agentId, startTimestamp, initialTimestamp, i + 1, maxConnectionSize, dataSourceBoSize);
        dataSourceListBos.add(dataSourceListBo);
    }
    return dataSourceListBos;
}
Also used : ArrayList(java.util.ArrayList) DataSourceListBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo)

Example 9 with DataSourceListBo

use of com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo in project pinpoint by naver.

the class HbaseSampledDataSourceDaoV2 method getSampledAgentStatList.

@Override
public List<SampledDataSourceList> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
    long scanFrom = timeWindow.getWindowRange().getFrom();
    long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
    Range range = new Range(scanFrom, scanTo);
    AgentStatMapperV2<DataSourceListBo> mapper = operations.createRowMapper(dataSourceDecoder, range);
    SampledDataSourceResultExtractor resultExtractor = new SampledDataSourceResultExtractor(timeWindow, mapper, dataSourceSampler);
    return operations.getSampledAgentStatList(AgentStatType.DATASOURCE, resultExtractor, agentId, range);
}
Also used : SampledDataSourceResultExtractor(com.navercorp.pinpoint.web.mapper.stat.SampledDataSourceResultExtractor) DataSourceListBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo) Range(com.navercorp.pinpoint.web.vo.Range)

Example 10 with DataSourceListBo

use of com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo in project pinpoint by naver.

the class SampledDataSourceResultExtractor method divideByDataSourceId.

private Map<Integer, List<DataSourceBo>> divideByDataSourceId(ResultScanner results) throws Exception {
    int rowNum = 0;
    Map<Integer, List<DataSourceBo>> dataSourceBoListMap = new HashMap<>();
    for (Result result : results) {
        for (DataSourceListBo dataPoint : this.rowMapper.mapRow(result, rowNum++)) {
            if (dataPoint.size() == 0) {
                continue;
            }
            DataSourceBo first = ListUtils.getFirst(dataPoint.getList(), null);
            int id = first.getId();
            List<DataSourceBo> dataSourceBoList = dataSourceBoListMap.get(id);
            if (dataSourceBoList == null) {
                dataSourceBoList = new ArrayList<>();
                dataSourceBoListMap.put(id, dataSourceBoList);
            }
            dataSourceBoList.addAll(dataPoint.getList());
        }
    }
    return dataSourceBoListMap;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) SampledDataSourceList(com.navercorp.pinpoint.web.vo.stat.SampledDataSourceList) List(java.util.List) DataSourceListBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo) DataSourceBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo) Result(org.apache.hadoop.hbase.client.Result)

Aggregations

DataSourceListBo (com.navercorp.pinpoint.common.server.bo.stat.DataSourceListBo)10 DataSourceBo (com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo)6 ArrayList (java.util.ArrayList)5 ActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)2 AgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)2 CpuLoadBo (com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo)2 JvmGcBo (com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo)2 JvmGcDetailedBo (com.navercorp.pinpoint.common.server.bo.stat.JvmGcDetailedBo)2 TransactionBo (com.navercorp.pinpoint.common.server.bo.stat.TransactionBo)2 TDataSource (com.navercorp.pinpoint.thrift.dto.TDataSource)2 TDataSourceList (com.navercorp.pinpoint.thrift.dto.TDataSourceList)2 AgentStatHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder)1 BitCountingHeaderDecoder (com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder)1 TAgentStat (com.navercorp.pinpoint.thrift.dto.TAgentStat)1 SampledDataSourceResultExtractor (com.navercorp.pinpoint.web.mapper.stat.SampledDataSourceResultExtractor)1 Range (com.navercorp.pinpoint.web.vo.Range)1 SampledDataSourceList (com.navercorp.pinpoint.web.vo.stat.SampledDataSourceList)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 List (java.util.List)1