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);
}
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();
}
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);
}
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;
}
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);
}
Aggregations