use of com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo in project pinpoint by naver.
the class GrpcAgentStatHandlerV2 method handleAgentUriStat.
private void handleAgentUriStat(PAgentUriStat agentUriStat) {
if (isDebug) {
logger.debug("Handle PAgentUriStat={}", MessageFormatUtils.debugLog(agentUriStat));
}
final AgentUriStatBo agentUriStatBo = agentUriStatMapper.map(agentUriStat);
agentUriStatService.save(agentUriStatBo);
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo in project pinpoint by naver.
the class HbaseSampledAgentUriStatDaoV2 method getSampledAgentStatList.
@Override
public List<SampledAgentUriStat> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
long scanFrom = timeWindow.getWindowRange().getFrom();
long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
Range range = Range.newRange(scanFrom, scanTo);
AgentStatMapperV2<AgentUriStatBo> mapper = operations.createRowMapper(agentUriStatDecoder, range);
SampledUriStatResultExtractor resultExtractor = new SampledUriStatResultExtractor(timeWindow, mapper, agentUriStatSampler);
List<SampledAgentUriStat> sampledAgentUriStatList = operations.getSampledAgentStatList(AgentStatType.URI, resultExtractor, agentId, range);
return sampledAgentUriStatList;
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo in project pinpoint by naver.
the class SampledUriStatResultExtractor method divideByUri.
private Map<String, List<EachUriStatBo>> divideByUri(ResultScanner results) throws Exception {
Map<String, List<EachUriStatBo>> eachUriStatBoListMap = new HashMap<>();
int rowNum = 0;
for (Result result : results) {
for (AgentUriStatBo agentUriStatBo : this.rowMapper.mapRow(result, rowNum++)) {
List<EachUriStatBo> eachUriStatBoList = agentUriStatBo.getEachUriStatBoList();
if (CollectionUtils.isEmpty(eachUriStatBoList)) {
continue;
}
final String agentId = agentUriStatBo.getAgentId();
final long startTimestamp = agentUriStatBo.getStartTimestamp();
final long timestamp = agentUriStatBo.getTimestamp();
for (EachUriStatBo eachUriStatBo : eachUriStatBoList) {
String uri = eachUriStatBo.getUri();
List<EachUriStatBo> eachUriStatBos = eachUriStatBoListMap.computeIfAbsent(uri, k -> new ArrayList<>());
setAgentStatDataPointBaseData(eachUriStatBo, agentId, startTimestamp, timestamp);
eachUriStatBos.add(eachUriStatBo);
}
}
}
return eachUriStatBoListMap;
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo in project pinpoint by naver.
the class GrpcAgentUriStatMapper method map.
public AgentUriStatBo map(final PAgentUriStat agentUriStat) {
final Header agentInfo = ServerContext.getAgentInfo();
final String agentId = agentInfo.getAgentId();
final long startTimestamp = agentInfo.getAgentStartTime();
long timestamp = agentUriStat.getTimestamp();
int bucketVersion = agentUriStat.getBucketVersion();
AgentUriStatBo agentUriStatBo = new AgentUriStatBo();
agentUriStatBo.setAgentId(agentId);
agentUriStatBo.setStartTimestamp(startTimestamp);
agentUriStatBo.setTimestamp(timestamp);
agentUriStatBo.setBucketVersion((byte) bucketVersion);
List<PEachUriStat> eachUriStatList = agentUriStat.getEachUriStatList();
for (PEachUriStat pEachUriStat : eachUriStatList) {
EachUriStatBo eachUriStatBo = createEachUriStatBo(pEachUriStat);
agentUriStatBo.addEachUriStatBo(eachUriStatBo);
}
return agentUriStatBo;
}
use of com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo in project pinpoint by naver.
the class AgentUriStatCodecV2 method encodeValues.
@Override
public void encodeValues(Buffer valueBuffer, List<AgentUriStatBo> agentUriStatBoList) {
final int numValues = CollectionUtils.nullSafeSize(agentUriStatBoList);
if (numValues != 1) {
return;
}
AgentUriStatBo agentUriStatBo = agentUriStatBoList.get(0);
long startTimestamp = agentUriStatBo.getStartTimestamp();
valueBuffer.putVLong(startTimestamp);
long timestamp = agentUriStatBo.getTimestamp();
valueBuffer.putVLong(timestamp);
byte bucketVersion = agentUriStatBo.getBucketVersion();
valueBuffer.putByte(bucketVersion);
List<EachUriStatBo> eachUriStatBoList = agentUriStatBo.getEachUriStatBoList();
int eachUriStatBoSize = CollectionUtils.nullSafeSize(eachUriStatBoList);
valueBuffer.putVInt(eachUriStatBoSize);
EachUriStatCodecV2 eachUriStatCodecV2 = new EachUriStatCodecV2(codec);
eachUriStatCodecV2.encodeValues(valueBuffer, eachUriStatBoList);
}
Aggregations