use of com.navercorp.pinpoint.grpc.trace.PEachUriStat in project pinpoint by naver.
the class GrpcUriStatMessageConverterTest method convertTest.
@Test
public void convertTest() {
long currentTimeMillis = System.currentTimeMillis();
AgentUriStatData agentUriStatData = new AgentUriStatData(currentTimeMillis);
List<UriStatInfo> uriStatInfoList = createRandomUriStatInfo(100);
for (UriStatInfo uriStatInfo : uriStatInfoList) {
agentUriStatData.add(uriStatInfo);
}
GrpcUriStatMessageConverter converter = new GrpcUriStatMessageConverter();
PAgentUriStat agentUriStat = converter.toMessage(agentUriStatData);
List<PEachUriStat> eachUriStatList = agentUriStat.getEachUriStatList();
assertData(uriStatInfoList, eachUriStatList);
}
use of com.navercorp.pinpoint.grpc.trace.PEachUriStat in project pinpoint by naver.
the class GrpcUriStatMessageConverter method createPAgentUriStat.
private PAgentUriStat createPAgentUriStat(AgentUriStatData agentUriStatData) {
long baseTimestamp = agentUriStatData.getBaseTimestamp();
PAgentUriStat.Builder builder = PAgentUriStat.newBuilder();
builder.setTimestamp(baseTimestamp);
builder.setBucketVersion(UriStatHistogramBucket.getBucketVersion());
Collection<EachUriStatData> allUriStatData = agentUriStatData.getAllUriStatData();
for (EachUriStatData eachUriStatData : allUriStatData) {
PEachUriStat pEachUriStat = createPEachUriStat(eachUriStatData);
builder.addEachUriStat(pEachUriStat);
}
return builder.build();
}
use of com.navercorp.pinpoint.grpc.trace.PEachUriStat in project pinpoint by naver.
the class GrpcUriStatMessageConverter method createPEachUriStat.
private PEachUriStat createPEachUriStat(EachUriStatData eachUriStatData) {
String uri = eachUriStatData.getUri();
PEachUriStat.Builder builder = PEachUriStat.newBuilder();
builder.setUri(uri);
UriStatHistogram totalHistogram = eachUriStatData.getTotalHistogram();
PUriHistogram totalPUriHistogram = createPUriHistogram(totalHistogram);
builder.setTotalHistogram(totalPUriHistogram);
UriStatHistogram failedHistogram = eachUriStatData.getFailedHistogram();
PUriHistogram failedPUriHistogram = createPUriHistogram(failedHistogram);
builder.setFailedHistogram(failedPUriHistogram);
return builder.build();
}
use of com.navercorp.pinpoint.grpc.trace.PEachUriStat 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.grpc.trace.PEachUriStat in project pinpoint by naver.
the class GrpcUriStatMessageConverterTest method assertData.
private void assertData(List<UriStatInfo> uriStatInfoList, List<PEachUriStat> eachUriStatList) {
for (PEachUriStat pEachUriStat : eachUriStatList) {
String uri = pEachUriStat.getUri();
assertData(getUriStatInfo(uriStatInfoList, uri), pEachUriStat.getTotalHistogram());
assertData(getFailedUriStatInfo(uriStatInfoList, uri), pEachUriStat.getFailedHistogram());
}
}
Aggregations