Search in sources :

Example 1 with PResult

use of com.navercorp.pinpoint.grpc.trace.PResult in project pinpoint by naver.

the class AgentClientMock method info.

public void info(final int count) {
    for (int i = 0; i < count; i++) {
        PAgentInfo request = PAgentInfo.newBuilder().build();
        QueueingStreamObserver<PResult> responseObserver = getResponseObserver();
        agentStub.requestAgentInfo(request, responseObserver);
        PResult value = responseObserver.getValue();
        logger.info("Result {}", value);
    }
}
Also used : PResult(com.navercorp.pinpoint.grpc.trace.PResult) PAgentInfo(com.navercorp.pinpoint.grpc.trace.PAgentInfo)

Example 2 with PResult

use of com.navercorp.pinpoint.grpc.trace.PResult in project pinpoint by naver.

the class AgentClientMock method sqlMetaData.

public void sqlMetaData(final int count) {
    for (int i = 0; i < count; i++) {
        PSqlMetaData request = PSqlMetaData.newBuilder().build();
        PResult result = metadataStub.requestSqlMetaData(request);
    }
}
Also used : PSqlMetaData(com.navercorp.pinpoint.grpc.trace.PSqlMetaData) PResult(com.navercorp.pinpoint.grpc.trace.PResult)

Example 3 with PResult

use of com.navercorp.pinpoint.grpc.trace.PResult in project pinpoint by naver.

the class MetadataClientMock method request.

private void request(GeneratedMessageV3 message, int retryCount) {
    if (retryCount <= 0) {
        logger.warn("Drop message {}", debugLog(message));
        return;
    }
    if (message instanceof PSqlMetaData) {
        PSqlMetaData sqlMetaData = (PSqlMetaData) message;
        StreamObserver<PResult> responseObserver = newResponseObserver(message, retryCount);
        this.metadataStub.requestSqlMetaData(sqlMetaData, responseObserver);
    } else if (message instanceof PApiMetaData) {
        final PApiMetaData apiMetaData = (PApiMetaData) message;
        StreamObserver<PResult> responseObserver = newResponseObserver(message, retryCount);
        this.metadataStub.requestApiMetaData(apiMetaData, responseObserver);
    } else if (message instanceof PStringMetaData) {
        final PStringMetaData stringMetaData = (PStringMetaData) message;
        StreamObserver<PResult> responseObserver = newResponseObserver(message, retryCount);
        this.metadataStub.requestStringMetaData(stringMetaData, responseObserver);
    } else {
        logger.warn("Unsupported message {}", debugLog(message));
    }
    int requestCount = requestCounter.getAndIncrement();
    logger.info("Request {} {}", requestCount, message);
    Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS);
}
Also used : StreamObserver(io.grpc.stub.StreamObserver) RetryResponseStreamObserver(com.navercorp.pinpoint.profiler.sender.grpc.RetryResponseStreamObserver) PSqlMetaData(com.navercorp.pinpoint.grpc.trace.PSqlMetaData) PStringMetaData(com.navercorp.pinpoint.grpc.trace.PStringMetaData) PResult(com.navercorp.pinpoint.grpc.trace.PResult) PApiMetaData(com.navercorp.pinpoint.grpc.trace.PApiMetaData)

Example 4 with PResult

use of com.navercorp.pinpoint.grpc.trace.PResult in project pinpoint by naver.

the class MetadataGrpcDataSender method request0.

// Request
private void request0(final GeneratedMessageV3 message, final int remainingRetryCount) {
    if (message instanceof PSqlMetaData) {
        final PSqlMetaData sqlMetaData = (PSqlMetaData) message;
        final StreamObserver<PResult> responseObserver = newResponseStream(message, remainingRetryCount);
        this.metadataStub.requestSqlMetaData(sqlMetaData, responseObserver);
    } else if (message instanceof PApiMetaData) {
        final PApiMetaData apiMetaData = (PApiMetaData) message;
        final StreamObserver<PResult> responseObserver = newResponseStream(message, remainingRetryCount);
        this.metadataStub.requestApiMetaData(apiMetaData, responseObserver);
    } else if (message instanceof PStringMetaData) {
        final PStringMetaData stringMetaData = (PStringMetaData) message;
        final StreamObserver<PResult> responseObserver = newResponseStream(message, remainingRetryCount);
        this.metadataStub.requestStringMetaData(stringMetaData, responseObserver);
    } else {
        logger.warn("Unsupported message {}", MessageFormatUtils.debugLog(message));
    }
}
Also used : StreamObserver(io.grpc.stub.StreamObserver) PSqlMetaData(com.navercorp.pinpoint.grpc.trace.PSqlMetaData) PStringMetaData(com.navercorp.pinpoint.grpc.trace.PStringMetaData) PResult(com.navercorp.pinpoint.grpc.trace.PResult) PApiMetaData(com.navercorp.pinpoint.grpc.trace.PApiMetaData)

Example 5 with PResult

use of com.navercorp.pinpoint.grpc.trace.PResult in project pinpoint by naver.

the class AgentClientMock method apiMetaData.

public void apiMetaData(final int count) {
    for (int i = 0; i < count; i++) {
        PApiMetaData request = PApiMetaData.newBuilder().build();
        PResult result = metadataStub.requestApiMetaData(request);
    }
}
Also used : PApiMetaData(com.navercorp.pinpoint.grpc.trace.PApiMetaData) PResult(com.navercorp.pinpoint.grpc.trace.PResult)

Aggregations

PResult (com.navercorp.pinpoint.grpc.trace.PResult)11 PSqlMetaData (com.navercorp.pinpoint.grpc.trace.PSqlMetaData)4 PStringMetaData (com.navercorp.pinpoint.grpc.trace.PStringMetaData)4 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)3 PAgentInfo (com.navercorp.pinpoint.grpc.trace.PAgentInfo)3 PApiMetaData (com.navercorp.pinpoint.grpc.trace.PApiMetaData)3 StreamObserver (io.grpc.stub.StreamObserver)2 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 ResultResponse (com.navercorp.pinpoint.profiler.sender.ResultResponse)1 RetryResponseStreamObserver (com.navercorp.pinpoint.profiler.sender.grpc.RetryResponseStreamObserver)1 ResponseMessage (com.navercorp.pinpoint.rpc.ResponseMessage)1 Channel (io.grpc.Channel)1 Test (org.junit.Test)1