Search in sources :

Example 1 with PEachUriStat

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);
}
Also used : AgentUriStatData(com.navercorp.pinpoint.profiler.monitor.metric.uri.AgentUriStatData) PAgentUriStat(com.navercorp.pinpoint.grpc.trace.PAgentUriStat) PEachUriStat(com.navercorp.pinpoint.grpc.trace.PEachUriStat) UriStatInfo(com.navercorp.pinpoint.profiler.monitor.metric.uri.UriStatInfo) Test(org.junit.Test)

Example 2 with PEachUriStat

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();
}
Also used : PAgentUriStat(com.navercorp.pinpoint.grpc.trace.PAgentUriStat) PEachUriStat(com.navercorp.pinpoint.grpc.trace.PEachUriStat) EachUriStatData(com.navercorp.pinpoint.profiler.monitor.metric.uri.EachUriStatData)

Example 3 with PEachUriStat

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();
}
Also used : PUriHistogram(com.navercorp.pinpoint.grpc.trace.PUriHistogram) PEachUriStat(com.navercorp.pinpoint.grpc.trace.PEachUriStat) UriStatHistogram(com.navercorp.pinpoint.profiler.monitor.metric.uri.UriStatHistogram)

Example 4 with PEachUriStat

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;
}
Also used : AgentUriStatBo(com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo) Header(com.navercorp.pinpoint.grpc.Header) PEachUriStat(com.navercorp.pinpoint.grpc.trace.PEachUriStat) EachUriStatBo(com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo)

Example 5 with PEachUriStat

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());
    }
}
Also used : PEachUriStat(com.navercorp.pinpoint.grpc.trace.PEachUriStat)

Aggregations

PEachUriStat (com.navercorp.pinpoint.grpc.trace.PEachUriStat)5 PAgentUriStat (com.navercorp.pinpoint.grpc.trace.PAgentUriStat)2 AgentUriStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentUriStatBo)1 EachUriStatBo (com.navercorp.pinpoint.common.server.bo.stat.EachUriStatBo)1 Header (com.navercorp.pinpoint.grpc.Header)1 PUriHistogram (com.navercorp.pinpoint.grpc.trace.PUriHistogram)1 AgentUriStatData (com.navercorp.pinpoint.profiler.monitor.metric.uri.AgentUriStatData)1 EachUriStatData (com.navercorp.pinpoint.profiler.monitor.metric.uri.EachUriStatData)1 UriStatHistogram (com.navercorp.pinpoint.profiler.monitor.metric.uri.UriStatHistogram)1 UriStatInfo (com.navercorp.pinpoint.profiler.monitor.metric.uri.UriStatInfo)1 Test (org.junit.Test)1