use of com.navercorp.pinpoint.grpc.trace.PStringMetaData in project pinpoint by naver.
the class MetadataClientMock method stringMetaData.
public void stringMetaData(final int count) {
for (int i = 0; i < count; i++) {
PStringMetaData request = PStringMetaData.newBuilder().build();
request(request, MAX_TOTAL_ATTEMPTS);
}
}
use of com.navercorp.pinpoint.grpc.trace.PStringMetaData 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);
}
use of com.navercorp.pinpoint.grpc.trace.PStringMetaData 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));
}
}
use of com.navercorp.pinpoint.grpc.trace.PStringMetaData in project pinpoint by naver.
the class AgentClientMock method stringMetaData.
public void stringMetaData(final int count) {
for (int i = 0; i < count; i++) {
PStringMetaData request = PStringMetaData.newBuilder().build();
PResult result = metadataStub.requestStringMetaData(request);
}
}
use of com.navercorp.pinpoint.grpc.trace.PStringMetaData in project pinpoint by naver.
the class GrpcStringMetaDataHandler method handleRequest.
@Override
public void handleRequest(ServerRequest<GeneratedMessageV3> serverRequest, ServerResponse<GeneratedMessageV3> serverResponse) {
final GeneratedMessageV3 data = serverRequest.getData();
if (data instanceof PStringMetaData) {
PResult result = handleStringMetaData((PStringMetaData) data);
serverResponse.write(result);
} else {
logger.warn("Invalid request type. serverRequest={}", serverRequest);
throw Status.INTERNAL.withDescription("Bad Request(invalid request type)").asRuntimeException();
}
}
Aggregations