Search in sources :

Example 1 with FileDescriptorBo

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

the class TFFileDescriptorMapperTest method mapTest.

@Test
public void mapTest() {
    TFFileDescriptorMapper tFFileDescriptorMapper = new TFFileDescriptorMapper();
    FileDescriptorBo fileDescriptorBo = new FileDescriptorBo();
    fileDescriptorBo.setOpenFileDescriptorCount(30);
    TFFileDescriptor tFFileDescriptor = tFFileDescriptorMapper.map(fileDescriptorBo);
    assertEquals(tFFileDescriptor.getOpenFileDescriptorCount(), 30, 0);
}
Also used : FileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo) TFFileDescriptor(com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor) Test(org.junit.Test)

Example 2 with FileDescriptorBo

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

the class TFAgentStatMapperTest method createFileDescriptorBoList.

private AgentStatBo createFileDescriptorBoList() {
    final AgentStatBo.Builder builder = newBuilder();
    FileDescriptorBo fileDescriptorBo1 = new FileDescriptorBo();
    fileDescriptorBo1.setOpenFileDescriptorCount(4);
    AgentStatBo.Builder.StatBuilder statBuilder1 = builder.newStatBuilder(collectTime1st);
    statBuilder1.addFileDescriptor(fileDescriptorBo1);
    FileDescriptorBo fileDescriptorBo2 = new FileDescriptorBo();
    fileDescriptorBo2.setOpenFileDescriptorCount(5);
    AgentStatBo.Builder.StatBuilder statBuilder2 = builder.newStatBuilder(collectTime2nd);
    statBuilder2.addFileDescriptor(fileDescriptorBo2);
    FileDescriptorBo fileDescriptorBo3 = new FileDescriptorBo();
    fileDescriptorBo3.setOpenFileDescriptorCount(8);
    AgentStatBo.Builder.StatBuilder statBuilder3 = builder.newStatBuilder(collectTime3rd);
    statBuilder3.addFileDescriptor(fileDescriptorBo3);
    return builder.build();
}
Also used : AgentStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo) FileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo)

Example 3 with FileDescriptorBo

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

the class HbaseSampledFileDescriptorDaoV2 method getSampledAgentStatList.

@Override
public List<SampledFileDescriptor> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
    long scanFrom = timeWindow.getWindowRange().getFrom();
    long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
    Range range = Range.newRange(scanFrom, scanTo);
    AgentStatMapperV2<FileDescriptorBo> mapper = operations.createRowMapper(fileDescriptorDecoder, range);
    SampledAgentStatResultExtractor<FileDescriptorBo, SampledFileDescriptor> resultExtractor = new SampledAgentStatResultExtractor<>(timeWindow, mapper, fileDescriptorSampler);
    return operations.getSampledAgentStatList(AgentStatType.FILE_DESCRIPTOR, resultExtractor, agentId, range);
}
Also used : FileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo) SampledAgentStatResultExtractor(com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor) Range(com.navercorp.pinpoint.web.vo.Range) SampledFileDescriptor(com.navercorp.pinpoint.web.vo.stat.SampledFileDescriptor)

Example 4 with FileDescriptorBo

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

the class FileDescriptorSampler method sampleDataPoints.

@Override
public SampledFileDescriptor sampleDataPoints(int timeWindowIndex, long timestamp, List<FileDescriptorBo> dataPoints, FileDescriptorBo previousDataPoint) {
    final AgentStatPoint<Long> openFileDescriptorCount = newAgentStatPoint(timestamp, dataPoints, FileDescriptorBo::getOpenFileDescriptorCount);
    SampledFileDescriptor sampledFileDescriptor = new SampledFileDescriptor(openFileDescriptorCount);
    return sampledFileDescriptor;
}
Also used : FileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo) SampledFileDescriptor(com.navercorp.pinpoint.web.vo.stat.SampledFileDescriptor)

Example 5 with FileDescriptorBo

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

the class FileDescriptorDataCollector method collect.

@Override
public void collect() {
    if (init.get()) {
        return;
    }
    Range range = Range.newUncheckedRange(timeSlotEndTime - slotInterval, timeSlotEndTime);
    List<String> agentIds = applicationIndexDao.selectAgentIds(application.getName());
    for (String agentId : agentIds) {
        List<FileDescriptorBo> fileDescriptorBoList = fileDescriptorDao.getAgentStatList(agentId, range);
        if (fileDescriptorBoList.size() == 0) {
            continue;
        }
        long fileDescriptorTotalCount = 0;
        int size = fileDescriptorBoList.size();
        for (FileDescriptorBo fileDescriptorBo : fileDescriptorBoList) {
            fileDescriptorTotalCount += fileDescriptorBo.getOpenFileDescriptorCount();
        }
        final long fileDescriptorAvgCount = fileDescriptorTotalCount / size;
        fileDescriptorCount.put(agentId, fileDescriptorAvgCount);
    }
    init.set(true);
}
Also used : FileDescriptorBo(com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo) Range(com.navercorp.pinpoint.web.vo.Range)

Aggregations

FileDescriptorBo (com.navercorp.pinpoint.common.server.bo.stat.FileDescriptorBo)11 Range (com.navercorp.pinpoint.web.vo.Range)3 AgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)2 SampledFileDescriptor (com.navercorp.pinpoint.web.vo.stat.SampledFileDescriptor)2 Test (org.junit.Test)2 PFileDescriptor (com.navercorp.pinpoint.grpc.trace.PFileDescriptor)1 TFFileDescriptor (com.navercorp.pinpoint.thrift.dto.flink.TFFileDescriptor)1 ApplicationIndexDao (com.navercorp.pinpoint.web.dao.ApplicationIndexDao)1 FileDescriptorDao (com.navercorp.pinpoint.web.dao.stat.FileDescriptorDao)1 SampledAgentStatResultExtractor (com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor)1 Application (com.navercorp.pinpoint.web.vo.Application)1 ArrayList (java.util.ArrayList)1