services: add monitoring service

This commit is contained in:
Eric Gribkoff 2017-03-02 15:04:46 -08:00 committed by GitHub
parent 99d6638e6e
commit f2beea6e9c
23 changed files with 24800 additions and 0 deletions

View File

@ -0,0 +1,500 @@
package io.grpc.instrumentation.v1alpha;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.2.0-SNAPSHOT)",
comments = "Source: grpc/instrumentation/v1alpha/monitoring.proto")
public final class MonitoringGrpc {
private MonitoringGrpc() {}
public static final String SERVICE_NAME = "grpc.instrumentation.v1alpha.Monitoring";
// Static method descriptors that strictly reflect the proto.
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor<com.google.protobuf.Empty,
io.grpc.instrumentation.v1alpha.CanonicalRpcStats> METHOD_GET_CANONICAL_RPC_STATS =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"grpc.instrumentation.v1alpha.Monitoring", "GetCanonicalRpcStats"),
io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.CanonicalRpcStats.getDefaultInstance()));
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor<io.grpc.instrumentation.v1alpha.StatsRequest,
io.grpc.instrumentation.v1alpha.StatsResponse> METHOD_GET_STATS =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"grpc.instrumentation.v1alpha.Monitoring", "GetStats"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.StatsRequest.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.StatsResponse.getDefaultInstance()));
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor<io.grpc.instrumentation.v1alpha.StatsRequest,
io.grpc.instrumentation.v1alpha.StatsResponse> METHOD_WATCH_STATS =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING,
generateFullMethodName(
"grpc.instrumentation.v1alpha.Monitoring", "WatchStats"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.StatsRequest.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.StatsResponse.getDefaultInstance()));
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor<io.grpc.instrumentation.v1alpha.TraceRequest,
io.grpc.instrumentation.v1alpha.TraceResponse> METHOD_GET_REQUEST_TRACES =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"grpc.instrumentation.v1alpha.Monitoring", "GetRequestTraces"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.TraceRequest.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.TraceResponse.getDefaultInstance()));
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor<io.grpc.instrumentation.v1alpha.MonitoringDataGroup,
io.grpc.instrumentation.v1alpha.CustomMonitoringData> METHOD_GET_CUSTOM_MONITORING_DATA =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"grpc.instrumentation.v1alpha.Monitoring", "GetCustomMonitoringData"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.MonitoringDataGroup.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.instrumentation.v1alpha.CustomMonitoringData.getDefaultInstance()));
/**
* Creates a new async stub that supports all call types for the service
*/
public static MonitoringStub newStub(io.grpc.Channel channel) {
return new MonitoringStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static MonitoringBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new MonitoringBlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service
*/
public static MonitoringFutureStub newFutureStub(
io.grpc.Channel channel) {
return new MonitoringFutureStub(channel);
}
/**
*/
public static abstract class MonitoringImplBase implements io.grpc.BindableService {
/**
* <pre>
* Return canonical RPC stats
* </pre>
*/
public void getCanonicalRpcStats(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.CanonicalRpcStats> responseObserver) {
asyncUnimplementedUnaryCall(METHOD_GET_CANONICAL_RPC_STATS, responseObserver);
}
/**
* <pre>
* Query the server for specific stats
* </pre>
*/
public void getStats(io.grpc.instrumentation.v1alpha.StatsRequest request,
io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.StatsResponse> responseObserver) {
asyncUnimplementedUnaryCall(METHOD_GET_STATS, responseObserver);
}
/**
* <pre>
* Request the server to stream back snapshots of the requested stats
* </pre>
*/
public void watchStats(io.grpc.instrumentation.v1alpha.StatsRequest request,
io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.StatsResponse> responseObserver) {
asyncUnimplementedUnaryCall(METHOD_WATCH_STATS, responseObserver);
}
/**
* <pre>
* Return request traces.
* </pre>
*/
public void getRequestTraces(io.grpc.instrumentation.v1alpha.TraceRequest request,
io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.TraceResponse> responseObserver) {
asyncUnimplementedUnaryCall(METHOD_GET_REQUEST_TRACES, responseObserver);
}
/**
* <pre>
* Return application-defined groups of monitoring data.
* This is a low level facility to allow extension of the monitoring API to
* application-specific monitoring data. Frameworks may use this to define
* additional groups of monitoring data made available by servers.
* </pre>
*/
public void getCustomMonitoringData(io.grpc.instrumentation.v1alpha.MonitoringDataGroup request,
io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.CustomMonitoringData> responseObserver) {
asyncUnimplementedUnaryCall(METHOD_GET_CUSTOM_MONITORING_DATA, responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
METHOD_GET_CANONICAL_RPC_STATS,
asyncUnaryCall(
new MethodHandlers<
com.google.protobuf.Empty,
io.grpc.instrumentation.v1alpha.CanonicalRpcStats>(
this, METHODID_GET_CANONICAL_RPC_STATS)))
.addMethod(
METHOD_GET_STATS,
asyncUnaryCall(
new MethodHandlers<
io.grpc.instrumentation.v1alpha.StatsRequest,
io.grpc.instrumentation.v1alpha.StatsResponse>(
this, METHODID_GET_STATS)))
.addMethod(
METHOD_WATCH_STATS,
asyncServerStreamingCall(
new MethodHandlers<
io.grpc.instrumentation.v1alpha.StatsRequest,
io.grpc.instrumentation.v1alpha.StatsResponse>(
this, METHODID_WATCH_STATS)))
.addMethod(
METHOD_GET_REQUEST_TRACES,
asyncUnaryCall(
new MethodHandlers<
io.grpc.instrumentation.v1alpha.TraceRequest,
io.grpc.instrumentation.v1alpha.TraceResponse>(
this, METHODID_GET_REQUEST_TRACES)))
.addMethod(
METHOD_GET_CUSTOM_MONITORING_DATA,
asyncUnaryCall(
new MethodHandlers<
io.grpc.instrumentation.v1alpha.MonitoringDataGroup,
io.grpc.instrumentation.v1alpha.CustomMonitoringData>(
this, METHODID_GET_CUSTOM_MONITORING_DATA)))
.build();
}
}
/**
*/
public static final class MonitoringStub extends io.grpc.stub.AbstractStub<MonitoringStub> {
private MonitoringStub(io.grpc.Channel channel) {
super(channel);
}
private MonitoringStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected MonitoringStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new MonitoringStub(channel, callOptions);
}
/**
* <pre>
* Return canonical RPC stats
* </pre>
*/
public void getCanonicalRpcStats(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.CanonicalRpcStats> responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_GET_CANONICAL_RPC_STATS, getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Query the server for specific stats
* </pre>
*/
public void getStats(io.grpc.instrumentation.v1alpha.StatsRequest request,
io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.StatsResponse> responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_GET_STATS, getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Request the server to stream back snapshots of the requested stats
* </pre>
*/
public void watchStats(io.grpc.instrumentation.v1alpha.StatsRequest request,
io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.StatsResponse> responseObserver) {
asyncServerStreamingCall(
getChannel().newCall(METHOD_WATCH_STATS, getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Return request traces.
* </pre>
*/
public void getRequestTraces(io.grpc.instrumentation.v1alpha.TraceRequest request,
io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.TraceResponse> responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_GET_REQUEST_TRACES, getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Return application-defined groups of monitoring data.
* This is a low level facility to allow extension of the monitoring API to
* application-specific monitoring data. Frameworks may use this to define
* additional groups of monitoring data made available by servers.
* </pre>
*/
public void getCustomMonitoringData(io.grpc.instrumentation.v1alpha.MonitoringDataGroup request,
io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.CustomMonitoringData> responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_GET_CUSTOM_MONITORING_DATA, getCallOptions()), request, responseObserver);
}
}
/**
*/
public static final class MonitoringBlockingStub extends io.grpc.stub.AbstractStub<MonitoringBlockingStub> {
private MonitoringBlockingStub(io.grpc.Channel channel) {
super(channel);
}
private MonitoringBlockingStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected MonitoringBlockingStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new MonitoringBlockingStub(channel, callOptions);
}
/**
* <pre>
* Return canonical RPC stats
* </pre>
*/
public io.grpc.instrumentation.v1alpha.CanonicalRpcStats getCanonicalRpcStats(com.google.protobuf.Empty request) {
return blockingUnaryCall(
getChannel(), METHOD_GET_CANONICAL_RPC_STATS, getCallOptions(), request);
}
/**
* <pre>
* Query the server for specific stats
* </pre>
*/
public io.grpc.instrumentation.v1alpha.StatsResponse getStats(io.grpc.instrumentation.v1alpha.StatsRequest request) {
return blockingUnaryCall(
getChannel(), METHOD_GET_STATS, getCallOptions(), request);
}
/**
* <pre>
* Request the server to stream back snapshots of the requested stats
* </pre>
*/
public java.util.Iterator<io.grpc.instrumentation.v1alpha.StatsResponse> watchStats(
io.grpc.instrumentation.v1alpha.StatsRequest request) {
return blockingServerStreamingCall(
getChannel(), METHOD_WATCH_STATS, getCallOptions(), request);
}
/**
* <pre>
* Return request traces.
* </pre>
*/
public io.grpc.instrumentation.v1alpha.TraceResponse getRequestTraces(io.grpc.instrumentation.v1alpha.TraceRequest request) {
return blockingUnaryCall(
getChannel(), METHOD_GET_REQUEST_TRACES, getCallOptions(), request);
}
/**
* <pre>
* Return application-defined groups of monitoring data.
* This is a low level facility to allow extension of the monitoring API to
* application-specific monitoring data. Frameworks may use this to define
* additional groups of monitoring data made available by servers.
* </pre>
*/
public io.grpc.instrumentation.v1alpha.CustomMonitoringData getCustomMonitoringData(io.grpc.instrumentation.v1alpha.MonitoringDataGroup request) {
return blockingUnaryCall(
getChannel(), METHOD_GET_CUSTOM_MONITORING_DATA, getCallOptions(), request);
}
}
/**
*/
public static final class MonitoringFutureStub extends io.grpc.stub.AbstractStub<MonitoringFutureStub> {
private MonitoringFutureStub(io.grpc.Channel channel) {
super(channel);
}
private MonitoringFutureStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected MonitoringFutureStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new MonitoringFutureStub(channel, callOptions);
}
/**
* <pre>
* Return canonical RPC stats
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<io.grpc.instrumentation.v1alpha.CanonicalRpcStats> getCanonicalRpcStats(
com.google.protobuf.Empty request) {
return futureUnaryCall(
getChannel().newCall(METHOD_GET_CANONICAL_RPC_STATS, getCallOptions()), request);
}
/**
* <pre>
* Query the server for specific stats
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<io.grpc.instrumentation.v1alpha.StatsResponse> getStats(
io.grpc.instrumentation.v1alpha.StatsRequest request) {
return futureUnaryCall(
getChannel().newCall(METHOD_GET_STATS, getCallOptions()), request);
}
/**
* <pre>
* Return request traces.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<io.grpc.instrumentation.v1alpha.TraceResponse> getRequestTraces(
io.grpc.instrumentation.v1alpha.TraceRequest request) {
return futureUnaryCall(
getChannel().newCall(METHOD_GET_REQUEST_TRACES, getCallOptions()), request);
}
/**
* <pre>
* Return application-defined groups of monitoring data.
* This is a low level facility to allow extension of the monitoring API to
* application-specific monitoring data. Frameworks may use this to define
* additional groups of monitoring data made available by servers.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<io.grpc.instrumentation.v1alpha.CustomMonitoringData> getCustomMonitoringData(
io.grpc.instrumentation.v1alpha.MonitoringDataGroup request) {
return futureUnaryCall(
getChannel().newCall(METHOD_GET_CUSTOM_MONITORING_DATA, getCallOptions()), request);
}
}
private static final int METHODID_GET_CANONICAL_RPC_STATS = 0;
private static final int METHODID_GET_STATS = 1;
private static final int METHODID_WATCH_STATS = 2;
private static final int METHODID_GET_REQUEST_TRACES = 3;
private static final int METHODID_GET_CUSTOM_MONITORING_DATA = 4;
private static final class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
private final MonitoringImplBase serviceImpl;
private final int methodId;
MethodHandlers(MonitoringImplBase serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
case METHODID_GET_CANONICAL_RPC_STATS:
serviceImpl.getCanonicalRpcStats((com.google.protobuf.Empty) request,
(io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.CanonicalRpcStats>) responseObserver);
break;
case METHODID_GET_STATS:
serviceImpl.getStats((io.grpc.instrumentation.v1alpha.StatsRequest) request,
(io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.StatsResponse>) responseObserver);
break;
case METHODID_WATCH_STATS:
serviceImpl.watchStats((io.grpc.instrumentation.v1alpha.StatsRequest) request,
(io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.StatsResponse>) responseObserver);
break;
case METHODID_GET_REQUEST_TRACES:
serviceImpl.getRequestTraces((io.grpc.instrumentation.v1alpha.TraceRequest) request,
(io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.TraceResponse>) responseObserver);
break;
case METHODID_GET_CUSTOM_MONITORING_DATA:
serviceImpl.getCustomMonitoringData((io.grpc.instrumentation.v1alpha.MonitoringDataGroup) request,
(io.grpc.stub.StreamObserver<io.grpc.instrumentation.v1alpha.CustomMonitoringData>) responseObserver);
break;
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver<Req> invoke(
io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
default:
throw new AssertionError();
}
}
}
private static final class MonitoringDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier {
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.getDescriptor();
}
}
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor result = serviceDescriptor;
if (result == null) {
synchronized (MonitoringGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new MonitoringDescriptorSupplier())
.addMethod(METHOD_GET_CANONICAL_RPC_STATS)
.addMethod(METHOD_GET_STATS)
.addMethod(METHOD_WATCH_STATS)
.addMethod(METHOD_GET_REQUEST_TRACES)
.addMethod(METHOD_GET_CUSTOM_MONITORING_DATA)
.build();
}
}
}
return result;
}
}

View File

@ -0,0 +1,242 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
public interface CanonicalRpcStatsOrBuilder extends
// @@protoc_insertion_point(interface_extends:grpc.instrumentation.v1alpha.CanonicalRpcStats)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_errors = 1;</code>
*/
boolean hasRpcClientErrors();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_errors = 1;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcClientErrors();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_errors = 1;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcClientErrorsOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_completed_rpcs = 2;</code>
*/
boolean hasRpcClientCompletedRpcs();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_completed_rpcs = 2;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcClientCompletedRpcs();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_completed_rpcs = 2;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcClientCompletedRpcsOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_started_rpcs = 3;</code>
*/
boolean hasRpcClientStartedRpcs();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_started_rpcs = 3;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcClientStartedRpcs();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_started_rpcs = 3;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcClientStartedRpcsOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_elapsed_time = 4;</code>
*/
boolean hasRpcClientElapsedTime();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_elapsed_time = 4;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcClientElapsedTime();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_elapsed_time = 4;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcClientElapsedTimeOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_server_elapsed_time = 5;</code>
*/
boolean hasRpcClientServerElapsedTime();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_server_elapsed_time = 5;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcClientServerElapsedTime();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_server_elapsed_time = 5;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcClientServerElapsedTimeOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_request_bytes = 6;</code>
*/
boolean hasRpcClientRequestBytes();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_request_bytes = 6;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcClientRequestBytes();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_request_bytes = 6;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcClientRequestBytesOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_response_bytes = 7;</code>
*/
boolean hasRpcClientResponseBytes();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_response_bytes = 7;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcClientResponseBytes();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_response_bytes = 7;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcClientResponseBytesOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_request_count = 8;</code>
*/
boolean hasRpcClientRequestCount();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_request_count = 8;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcClientRequestCount();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_request_count = 8;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcClientRequestCountOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_response_count = 9;</code>
*/
boolean hasRpcClientResponseCount();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_response_count = 9;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcClientResponseCount();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_client_response_count = 9;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcClientResponseCountOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_errors = 10;</code>
*/
boolean hasRpcServerErrors();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_errors = 10;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcServerErrors();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_errors = 10;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcServerErrorsOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_completed_rpcs = 11;</code>
*/
boolean hasRpcServerCompletedRpcs();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_completed_rpcs = 11;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcServerCompletedRpcs();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_completed_rpcs = 11;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcServerCompletedRpcsOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_server_elapsed_time = 12;</code>
*/
boolean hasRpcServerServerElapsedTime();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_server_elapsed_time = 12;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcServerServerElapsedTime();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_server_elapsed_time = 12;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcServerServerElapsedTimeOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_request_bytes = 13;</code>
*/
boolean hasRpcServerRequestBytes();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_request_bytes = 13;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcServerRequestBytes();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_request_bytes = 13;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcServerRequestBytesOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_response_bytes = 14;</code>
*/
boolean hasRpcServerResponseBytes();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_response_bytes = 14;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcServerResponseBytes();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_response_bytes = 14;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcServerResponseBytesOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_request_count = 15;</code>
*/
boolean hasRpcServerRequestCount();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_request_count = 15;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcServerRequestCount();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_request_count = 15;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcServerRequestCountOrBuilder();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_response_count = 16;</code>
*/
boolean hasRpcServerResponseCount();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_response_count = 16;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcServerResponseCount();
/**
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_response_count = 16;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcServerResponseCountOrBuilder();
/**
* <pre>
*TODO(ericgribkoff) Add minute-hour interval stats.
* </pre>
*
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_elapsed_time = 17;</code>
*/
boolean hasRpcServerElapsedTime();
/**
* <pre>
*TODO(ericgribkoff) Add minute-hour interval stats.
* </pre>
*
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_elapsed_time = 17;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.View getRpcServerElapsedTime();
/**
* <pre>
*TODO(ericgribkoff) Add minute-hour interval stats.
* </pre>
*
* <code>.grpc.instrumentation.v1alpha.CanonicalRpcStats.View rpc_server_elapsed_time = 17;</code>
*/
io.grpc.instrumentation.v1alpha.CanonicalRpcStats.ViewOrBuilder getRpcServerElapsedTimeOrBuilder();
}

View File

@ -0,0 +1,604 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
/**
* <pre>
* The wrapper for custom monitoring data.
* </pre>
*
* Protobuf type {@code grpc.instrumentation.v1alpha.CustomMonitoringData}
*/
public final class CustomMonitoringData extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:grpc.instrumentation.v1alpha.CustomMonitoringData)
CustomMonitoringDataOrBuilder {
// Use CustomMonitoringData.newBuilder() to construct.
private CustomMonitoringData(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private CustomMonitoringData() {
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private CustomMonitoringData(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
com.google.protobuf.Any.Builder subBuilder = null;
if (contents_ != null) {
subBuilder = contents_.toBuilder();
}
contents_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(contents_);
contents_ = subBuilder.buildPartial();
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_CustomMonitoringData_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_CustomMonitoringData_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.instrumentation.v1alpha.CustomMonitoringData.class, io.grpc.instrumentation.v1alpha.CustomMonitoringData.Builder.class);
}
public static final int CONTENTS_FIELD_NUMBER = 1;
private com.google.protobuf.Any contents_;
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
public boolean hasContents() {
return contents_ != null;
}
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
public com.google.protobuf.Any getContents() {
return contents_ == null ? com.google.protobuf.Any.getDefaultInstance() : contents_;
}
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
public com.google.protobuf.AnyOrBuilder getContentsOrBuilder() {
return getContents();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (contents_ != null) {
output.writeMessage(1, getContents());
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (contents_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getContents());
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.grpc.instrumentation.v1alpha.CustomMonitoringData)) {
return super.equals(obj);
}
io.grpc.instrumentation.v1alpha.CustomMonitoringData other = (io.grpc.instrumentation.v1alpha.CustomMonitoringData) obj;
boolean result = true;
result = result && (hasContents() == other.hasContents());
if (hasContents()) {
result = result && getContents()
.equals(other.getContents());
}
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasContents()) {
hash = (37 * hash) + CONTENTS_FIELD_NUMBER;
hash = (53 * hash) + getContents().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grpc.instrumentation.v1alpha.CustomMonitoringData parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.instrumentation.v1alpha.CustomMonitoringData parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.CustomMonitoringData parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.instrumentation.v1alpha.CustomMonitoringData parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.CustomMonitoringData parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.CustomMonitoringData parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.CustomMonitoringData parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.CustomMonitoringData parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.CustomMonitoringData parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.CustomMonitoringData parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.instrumentation.v1alpha.CustomMonitoringData prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* The wrapper for custom monitoring data.
* </pre>
*
* Protobuf type {@code grpc.instrumentation.v1alpha.CustomMonitoringData}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:grpc.instrumentation.v1alpha.CustomMonitoringData)
io.grpc.instrumentation.v1alpha.CustomMonitoringDataOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_CustomMonitoringData_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_CustomMonitoringData_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.instrumentation.v1alpha.CustomMonitoringData.class, io.grpc.instrumentation.v1alpha.CustomMonitoringData.Builder.class);
}
// Construct using io.grpc.instrumentation.v1alpha.CustomMonitoringData.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
if (contentsBuilder_ == null) {
contents_ = null;
} else {
contents_ = null;
contentsBuilder_ = null;
}
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_CustomMonitoringData_descriptor;
}
public io.grpc.instrumentation.v1alpha.CustomMonitoringData getDefaultInstanceForType() {
return io.grpc.instrumentation.v1alpha.CustomMonitoringData.getDefaultInstance();
}
public io.grpc.instrumentation.v1alpha.CustomMonitoringData build() {
io.grpc.instrumentation.v1alpha.CustomMonitoringData result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.instrumentation.v1alpha.CustomMonitoringData buildPartial() {
io.grpc.instrumentation.v1alpha.CustomMonitoringData result = new io.grpc.instrumentation.v1alpha.CustomMonitoringData(this);
if (contentsBuilder_ == null) {
result.contents_ = contents_;
} else {
result.contents_ = contentsBuilder_.build();
}
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.instrumentation.v1alpha.CustomMonitoringData) {
return mergeFrom((io.grpc.instrumentation.v1alpha.CustomMonitoringData)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.instrumentation.v1alpha.CustomMonitoringData other) {
if (other == io.grpc.instrumentation.v1alpha.CustomMonitoringData.getDefaultInstance()) return this;
if (other.hasContents()) {
mergeContents(other.getContents());
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.instrumentation.v1alpha.CustomMonitoringData parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.instrumentation.v1alpha.CustomMonitoringData) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private com.google.protobuf.Any contents_ = null;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> contentsBuilder_;
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
public boolean hasContents() {
return contentsBuilder_ != null || contents_ != null;
}
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
public com.google.protobuf.Any getContents() {
if (contentsBuilder_ == null) {
return contents_ == null ? com.google.protobuf.Any.getDefaultInstance() : contents_;
} else {
return contentsBuilder_.getMessage();
}
}
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
public Builder setContents(com.google.protobuf.Any value) {
if (contentsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
contents_ = value;
onChanged();
} else {
contentsBuilder_.setMessage(value);
}
return this;
}
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
public Builder setContents(
com.google.protobuf.Any.Builder builderForValue) {
if (contentsBuilder_ == null) {
contents_ = builderForValue.build();
onChanged();
} else {
contentsBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
public Builder mergeContents(com.google.protobuf.Any value) {
if (contentsBuilder_ == null) {
if (contents_ != null) {
contents_ =
com.google.protobuf.Any.newBuilder(contents_).mergeFrom(value).buildPartial();
} else {
contents_ = value;
}
onChanged();
} else {
contentsBuilder_.mergeFrom(value);
}
return this;
}
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
public Builder clearContents() {
if (contentsBuilder_ == null) {
contents_ = null;
onChanged();
} else {
contents_ = null;
contentsBuilder_ = null;
}
return this;
}
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
public com.google.protobuf.Any.Builder getContentsBuilder() {
onChanged();
return getContentsFieldBuilder().getBuilder();
}
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
public com.google.protobuf.AnyOrBuilder getContentsOrBuilder() {
if (contentsBuilder_ != null) {
return contentsBuilder_.getMessageOrBuilder();
} else {
return contents_ == null ?
com.google.protobuf.Any.getDefaultInstance() : contents_;
}
}
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>
getContentsFieldBuilder() {
if (contentsBuilder_ == null) {
contentsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>(
getContents(),
getParentForChildren(),
isClean());
contents_ = null;
}
return contentsBuilder_;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:grpc.instrumentation.v1alpha.CustomMonitoringData)
}
// @@protoc_insertion_point(class_scope:grpc.instrumentation.v1alpha.CustomMonitoringData)
private static final io.grpc.instrumentation.v1alpha.CustomMonitoringData DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.instrumentation.v1alpha.CustomMonitoringData();
}
public static io.grpc.instrumentation.v1alpha.CustomMonitoringData getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<CustomMonitoringData>
PARSER = new com.google.protobuf.AbstractParser<CustomMonitoringData>() {
public CustomMonitoringData parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new CustomMonitoringData(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<CustomMonitoringData> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<CustomMonitoringData> getParserForType() {
return PARSER;
}
public io.grpc.instrumentation.v1alpha.CustomMonitoringData getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -0,0 +1,34 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
public interface CustomMonitoringDataOrBuilder extends
// @@protoc_insertion_point(interface_extends:grpc.instrumentation.v1alpha.CustomMonitoringData)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
boolean hasContents();
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
com.google.protobuf.Any getContents();
/**
* <pre>
* can be any application specific monitoring data
* </pre>
*
* <code>.google.protobuf.Any contents = 1;</code>
*/
com.google.protobuf.AnyOrBuilder getContentsOrBuilder();
}

View File

@ -0,0 +1,522 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
/**
* Protobuf type {@code grpc.instrumentation.v1alpha.MonitoringDataGroup}
*/
public final class MonitoringDataGroup extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:grpc.instrumentation.v1alpha.MonitoringDataGroup)
MonitoringDataGroupOrBuilder {
// Use MonitoringDataGroup.newBuilder() to construct.
private MonitoringDataGroup(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private MonitoringDataGroup() {
name_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private MonitoringDataGroup(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_MonitoringDataGroup_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_MonitoringDataGroup_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.instrumentation.v1alpha.MonitoringDataGroup.class, io.grpc.instrumentation.v1alpha.MonitoringDataGroup.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
* <pre>
* name of a group of monitoring data
* </pre>
*
* <code>string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
* <pre>
* name of a group of monitoring data
* </pre>
*
* <code>string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.grpc.instrumentation.v1alpha.MonitoringDataGroup)) {
return super.equals(obj);
}
io.grpc.instrumentation.v1alpha.MonitoringDataGroup other = (io.grpc.instrumentation.v1alpha.MonitoringDataGroup) obj;
boolean result = true;
result = result && getName()
.equals(other.getName());
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grpc.instrumentation.v1alpha.MonitoringDataGroup parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.instrumentation.v1alpha.MonitoringDataGroup parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.MonitoringDataGroup parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.instrumentation.v1alpha.MonitoringDataGroup parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.MonitoringDataGroup parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.MonitoringDataGroup parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.MonitoringDataGroup parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.MonitoringDataGroup parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.MonitoringDataGroup parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.MonitoringDataGroup parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.instrumentation.v1alpha.MonitoringDataGroup prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code grpc.instrumentation.v1alpha.MonitoringDataGroup}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:grpc.instrumentation.v1alpha.MonitoringDataGroup)
io.grpc.instrumentation.v1alpha.MonitoringDataGroupOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_MonitoringDataGroup_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_MonitoringDataGroup_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.instrumentation.v1alpha.MonitoringDataGroup.class, io.grpc.instrumentation.v1alpha.MonitoringDataGroup.Builder.class);
}
// Construct using io.grpc.instrumentation.v1alpha.MonitoringDataGroup.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
name_ = "";
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_MonitoringDataGroup_descriptor;
}
public io.grpc.instrumentation.v1alpha.MonitoringDataGroup getDefaultInstanceForType() {
return io.grpc.instrumentation.v1alpha.MonitoringDataGroup.getDefaultInstance();
}
public io.grpc.instrumentation.v1alpha.MonitoringDataGroup build() {
io.grpc.instrumentation.v1alpha.MonitoringDataGroup result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.instrumentation.v1alpha.MonitoringDataGroup buildPartial() {
io.grpc.instrumentation.v1alpha.MonitoringDataGroup result = new io.grpc.instrumentation.v1alpha.MonitoringDataGroup(this);
result.name_ = name_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.instrumentation.v1alpha.MonitoringDataGroup) {
return mergeFrom((io.grpc.instrumentation.v1alpha.MonitoringDataGroup)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.instrumentation.v1alpha.MonitoringDataGroup other) {
if (other == io.grpc.instrumentation.v1alpha.MonitoringDataGroup.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.instrumentation.v1alpha.MonitoringDataGroup parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.instrumentation.v1alpha.MonitoringDataGroup) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object name_ = "";
/**
* <pre>
* name of a group of monitoring data
* </pre>
*
* <code>string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
* name of a group of monitoring data
* </pre>
*
* <code>string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
* name of a group of monitoring data
* </pre>
*
* <code>string name = 1;</code>
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
* <pre>
* name of a group of monitoring data
* </pre>
*
* <code>string name = 1;</code>
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* <pre>
* name of a group of monitoring data
* </pre>
*
* <code>string name = 1;</code>
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:grpc.instrumentation.v1alpha.MonitoringDataGroup)
}
// @@protoc_insertion_point(class_scope:grpc.instrumentation.v1alpha.MonitoringDataGroup)
private static final io.grpc.instrumentation.v1alpha.MonitoringDataGroup DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.instrumentation.v1alpha.MonitoringDataGroup();
}
public static io.grpc.instrumentation.v1alpha.MonitoringDataGroup getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<MonitoringDataGroup>
PARSER = new com.google.protobuf.AbstractParser<MonitoringDataGroup>() {
public MonitoringDataGroup parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new MonitoringDataGroup(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<MonitoringDataGroup> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<MonitoringDataGroup> getParserForType() {
return PARSER;
}
public io.grpc.instrumentation.v1alpha.MonitoringDataGroup getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -0,0 +1,27 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
public interface MonitoringDataGroupOrBuilder extends
// @@protoc_insertion_point(interface_extends:grpc.instrumentation.v1alpha.MonitoringDataGroup)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* name of a group of monitoring data
* </pre>
*
* <code>string name = 1;</code>
*/
java.lang.String getName();
/**
* <pre>
* name of a group of monitoring data
* </pre>
*
* <code>string name = 1;</code>
*/
com.google.protobuf.ByteString
getNameBytes();
}

View File

@ -0,0 +1,204 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
public final class MonitoringProto {
private MonitoringProto() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_grpc_instrumentation_v1alpha_CanonicalRpcStats_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_grpc_instrumentation_v1alpha_CanonicalRpcStats_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_grpc_instrumentation_v1alpha_CanonicalRpcStats_View_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_grpc_instrumentation_v1alpha_CanonicalRpcStats_View_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_grpc_instrumentation_v1alpha_StatsRequest_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_grpc_instrumentation_v1alpha_StatsRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_grpc_instrumentation_v1alpha_StatsResponse_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_grpc_instrumentation_v1alpha_StatsResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_grpc_instrumentation_v1alpha_TraceRequest_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_grpc_instrumentation_v1alpha_TraceRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_grpc_instrumentation_v1alpha_TraceResponse_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_grpc_instrumentation_v1alpha_TraceResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_grpc_instrumentation_v1alpha_MonitoringDataGroup_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_grpc_instrumentation_v1alpha_MonitoringDataGroup_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_grpc_instrumentation_v1alpha_CustomMonitoringData_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_grpc_instrumentation_v1alpha_CustomMonitoringData_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n-grpc/instrumentation/v1alpha/monitorin" +
"g.proto\022\034grpc.instrumentation.v1alpha\032#g" +
"oogle/instrumentation/census.proto\032\031goog" +
"le/protobuf/any.proto\032\033google/protobuf/e" +
"mpty.proto\"\261\r\n\021CanonicalRpcStats\022O\n\021rpc_" +
"client_errors\030\001 \001(\01324.grpc.instrumentati" +
"on.v1alpha.CanonicalRpcStats.View\022W\n\031rpc" +
"_client_completed_rpcs\030\002 \001(\01324.grpc.inst" +
"rumentation.v1alpha.CanonicalRpcStats.Vi" +
"ew\022U\n\027rpc_client_started_rpcs\030\003 \001(\01324.gr",
"pc.instrumentation.v1alpha.CanonicalRpcS" +
"tats.View\022U\n\027rpc_client_elapsed_time\030\004 \001" +
"(\01324.grpc.instrumentation.v1alpha.Canoni" +
"calRpcStats.View\022\\\n\036rpc_client_server_el" +
"apsed_time\030\005 \001(\01324.grpc.instrumentation." +
"v1alpha.CanonicalRpcStats.View\022V\n\030rpc_cl" +
"ient_request_bytes\030\006 \001(\01324.grpc.instrume" +
"ntation.v1alpha.CanonicalRpcStats.View\022W" +
"\n\031rpc_client_response_bytes\030\007 \001(\01324.grpc" +
".instrumentation.v1alpha.CanonicalRpcSta",
"ts.View\022V\n\030rpc_client_request_count\030\010 \001(" +
"\01324.grpc.instrumentation.v1alpha.Canonic" +
"alRpcStats.View\022W\n\031rpc_client_response_c" +
"ount\030\t \001(\01324.grpc.instrumentation.v1alph" +
"a.CanonicalRpcStats.View\022O\n\021rpc_server_e" +
"rrors\030\n \001(\01324.grpc.instrumentation.v1alp" +
"ha.CanonicalRpcStats.View\022W\n\031rpc_server_" +
"completed_rpcs\030\013 \001(\01324.grpc.instrumentat" +
"ion.v1alpha.CanonicalRpcStats.View\022\\\n\036rp" +
"c_server_server_elapsed_time\030\014 \001(\01324.grp",
"c.instrumentation.v1alpha.CanonicalRpcSt" +
"ats.View\022V\n\030rpc_server_request_bytes\030\r \001" +
"(\01324.grpc.instrumentation.v1alpha.Canoni" +
"calRpcStats.View\022W\n\031rpc_server_response_" +
"bytes\030\016 \001(\01324.grpc.instrumentation.v1alp" +
"ha.CanonicalRpcStats.View\022V\n\030rpc_server_" +
"request_count\030\017 \001(\01324.grpc.instrumentati" +
"on.v1alpha.CanonicalRpcStats.View\022W\n\031rpc" +
"_server_response_count\030\020 \001(\01324.grpc.inst" +
"rumentation.v1alpha.CanonicalRpcStats.Vi",
"ew\022U\n\027rpc_server_elapsed_time\030\021 \001(\01324.gr" +
"pc.instrumentation.v1alpha.CanonicalRpcS" +
"tats.View\032\302\001\n\004View\022M\n\026measurement_descri" +
"ptor\030\001 \001(\0132-.google.instrumentation.Meas" +
"urementDescriptor\022?\n\017view_descriptor\030\002 \001" +
"(\0132&.google.instrumentation.ViewDescript" +
"or\022*\n\004view\030\003 \001(\0132\034.google.instrumentatio" +
"n.View\"\016\n\014StatsRequest\"\017\n\rStatsResponse\"" +
"\016\n\014TraceRequest\"\017\n\rTraceResponse\"#\n\023Moni" +
"toringDataGroup\022\014\n\004name\030\001 \001(\t\">\n\024CustomM",
"onitoringData\022&\n\010contents\030\001 \001(\0132\024.google" +
".protobuf.Any2\265\004\n\nMonitoring\022a\n\024GetCanon" +
"icalRpcStats\022\026.google.protobuf.Empty\032/.g" +
"rpc.instrumentation.v1alpha.CanonicalRpc" +
"Stats\"\000\022e\n\010GetStats\022*.grpc.instrumentati" +
"on.v1alpha.StatsRequest\032+.grpc.instrumen" +
"tation.v1alpha.StatsResponse\"\000\022i\n\nWatchS" +
"tats\022*.grpc.instrumentation.v1alpha.Stat" +
"sRequest\032+.grpc.instrumentation.v1alpha." +
"StatsResponse\"\0000\001\022m\n\020GetRequestTraces\022*.",
"grpc.instrumentation.v1alpha.TraceReques" +
"t\032+.grpc.instrumentation.v1alpha.TraceRe" +
"sponse\"\000\022\202\001\n\027GetCustomMonitoringData\0221.g" +
"rpc.instrumentation.v1alpha.MonitoringDa" +
"taGroup\0322.grpc.instrumentation.v1alpha.C" +
"ustomMonitoringData\"\000B4\n\037io.grpc.instrum" +
"entation.v1alphaB\017MonitoringProtoP\001b\006pro" +
"to3"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
com.google.instrumentation.stats.proto.CensusProto.getDescriptor(),
com.google.protobuf.AnyProto.getDescriptor(),
com.google.protobuf.EmptyProto.getDescriptor(),
}, assigner);
internal_static_grpc_instrumentation_v1alpha_CanonicalRpcStats_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_grpc_instrumentation_v1alpha_CanonicalRpcStats_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_grpc_instrumentation_v1alpha_CanonicalRpcStats_descriptor,
new java.lang.String[] { "RpcClientErrors", "RpcClientCompletedRpcs", "RpcClientStartedRpcs", "RpcClientElapsedTime", "RpcClientServerElapsedTime", "RpcClientRequestBytes", "RpcClientResponseBytes", "RpcClientRequestCount", "RpcClientResponseCount", "RpcServerErrors", "RpcServerCompletedRpcs", "RpcServerServerElapsedTime", "RpcServerRequestBytes", "RpcServerResponseBytes", "RpcServerRequestCount", "RpcServerResponseCount", "RpcServerElapsedTime", });
internal_static_grpc_instrumentation_v1alpha_CanonicalRpcStats_View_descriptor =
internal_static_grpc_instrumentation_v1alpha_CanonicalRpcStats_descriptor.getNestedTypes().get(0);
internal_static_grpc_instrumentation_v1alpha_CanonicalRpcStats_View_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_grpc_instrumentation_v1alpha_CanonicalRpcStats_View_descriptor,
new java.lang.String[] { "MeasurementDescriptor", "ViewDescriptor", "View", });
internal_static_grpc_instrumentation_v1alpha_StatsRequest_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_grpc_instrumentation_v1alpha_StatsRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_grpc_instrumentation_v1alpha_StatsRequest_descriptor,
new java.lang.String[] { });
internal_static_grpc_instrumentation_v1alpha_StatsResponse_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_grpc_instrumentation_v1alpha_StatsResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_grpc_instrumentation_v1alpha_StatsResponse_descriptor,
new java.lang.String[] { });
internal_static_grpc_instrumentation_v1alpha_TraceRequest_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_grpc_instrumentation_v1alpha_TraceRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_grpc_instrumentation_v1alpha_TraceRequest_descriptor,
new java.lang.String[] { });
internal_static_grpc_instrumentation_v1alpha_TraceResponse_descriptor =
getDescriptor().getMessageTypes().get(4);
internal_static_grpc_instrumentation_v1alpha_TraceResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_grpc_instrumentation_v1alpha_TraceResponse_descriptor,
new java.lang.String[] { });
internal_static_grpc_instrumentation_v1alpha_MonitoringDataGroup_descriptor =
getDescriptor().getMessageTypes().get(5);
internal_static_grpc_instrumentation_v1alpha_MonitoringDataGroup_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_grpc_instrumentation_v1alpha_MonitoringDataGroup_descriptor,
new java.lang.String[] { "Name", });
internal_static_grpc_instrumentation_v1alpha_CustomMonitoringData_descriptor =
getDescriptor().getMessageTypes().get(6);
internal_static_grpc_instrumentation_v1alpha_CustomMonitoringData_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_grpc_instrumentation_v1alpha_CustomMonitoringData_descriptor,
new java.lang.String[] { "Contents", });
com.google.instrumentation.stats.proto.CensusProto.getDescriptor();
com.google.protobuf.AnyProto.getDescriptor();
com.google.protobuf.EmptyProto.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@ -0,0 +1,374 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
/**
* <pre>
* TODO(aveitch): Complete definition of this type
* </pre>
*
* Protobuf type {@code grpc.instrumentation.v1alpha.StatsRequest}
*/
public final class StatsRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:grpc.instrumentation.v1alpha.StatsRequest)
StatsRequestOrBuilder {
// Use StatsRequest.newBuilder() to construct.
private StatsRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private StatsRequest() {
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private StatsRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_StatsRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_StatsRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.instrumentation.v1alpha.StatsRequest.class, io.grpc.instrumentation.v1alpha.StatsRequest.Builder.class);
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.grpc.instrumentation.v1alpha.StatsRequest)) {
return super.equals(obj);
}
io.grpc.instrumentation.v1alpha.StatsRequest other = (io.grpc.instrumentation.v1alpha.StatsRequest) obj;
boolean result = true;
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grpc.instrumentation.v1alpha.StatsRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.instrumentation.v1alpha.StatsRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.StatsRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.instrumentation.v1alpha.StatsRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.StatsRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.StatsRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.StatsRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.StatsRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.StatsRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.StatsRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.instrumentation.v1alpha.StatsRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* TODO(aveitch): Complete definition of this type
* </pre>
*
* Protobuf type {@code grpc.instrumentation.v1alpha.StatsRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:grpc.instrumentation.v1alpha.StatsRequest)
io.grpc.instrumentation.v1alpha.StatsRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_StatsRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_StatsRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.instrumentation.v1alpha.StatsRequest.class, io.grpc.instrumentation.v1alpha.StatsRequest.Builder.class);
}
// Construct using io.grpc.instrumentation.v1alpha.StatsRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_StatsRequest_descriptor;
}
public io.grpc.instrumentation.v1alpha.StatsRequest getDefaultInstanceForType() {
return io.grpc.instrumentation.v1alpha.StatsRequest.getDefaultInstance();
}
public io.grpc.instrumentation.v1alpha.StatsRequest build() {
io.grpc.instrumentation.v1alpha.StatsRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.instrumentation.v1alpha.StatsRequest buildPartial() {
io.grpc.instrumentation.v1alpha.StatsRequest result = new io.grpc.instrumentation.v1alpha.StatsRequest(this);
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.instrumentation.v1alpha.StatsRequest) {
return mergeFrom((io.grpc.instrumentation.v1alpha.StatsRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.instrumentation.v1alpha.StatsRequest other) {
if (other == io.grpc.instrumentation.v1alpha.StatsRequest.getDefaultInstance()) return this;
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.instrumentation.v1alpha.StatsRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.instrumentation.v1alpha.StatsRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:grpc.instrumentation.v1alpha.StatsRequest)
}
// @@protoc_insertion_point(class_scope:grpc.instrumentation.v1alpha.StatsRequest)
private static final io.grpc.instrumentation.v1alpha.StatsRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.instrumentation.v1alpha.StatsRequest();
}
public static io.grpc.instrumentation.v1alpha.StatsRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<StatsRequest>
PARSER = new com.google.protobuf.AbstractParser<StatsRequest>() {
public StatsRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new StatsRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<StatsRequest> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<StatsRequest> getParserForType() {
return PARSER;
}
public io.grpc.instrumentation.v1alpha.StatsRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -0,0 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
public interface StatsRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:grpc.instrumentation.v1alpha.StatsRequest)
com.google.protobuf.MessageOrBuilder {
}

View File

@ -0,0 +1,374 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
/**
* <pre>
* TODO(aveitch): Complete definition of this type
* </pre>
*
* Protobuf type {@code grpc.instrumentation.v1alpha.StatsResponse}
*/
public final class StatsResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:grpc.instrumentation.v1alpha.StatsResponse)
StatsResponseOrBuilder {
// Use StatsResponse.newBuilder() to construct.
private StatsResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private StatsResponse() {
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private StatsResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_StatsResponse_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_StatsResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.instrumentation.v1alpha.StatsResponse.class, io.grpc.instrumentation.v1alpha.StatsResponse.Builder.class);
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.grpc.instrumentation.v1alpha.StatsResponse)) {
return super.equals(obj);
}
io.grpc.instrumentation.v1alpha.StatsResponse other = (io.grpc.instrumentation.v1alpha.StatsResponse) obj;
boolean result = true;
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grpc.instrumentation.v1alpha.StatsResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.instrumentation.v1alpha.StatsResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.StatsResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.instrumentation.v1alpha.StatsResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.StatsResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.StatsResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.StatsResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.StatsResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.StatsResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.StatsResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.instrumentation.v1alpha.StatsResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* TODO(aveitch): Complete definition of this type
* </pre>
*
* Protobuf type {@code grpc.instrumentation.v1alpha.StatsResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:grpc.instrumentation.v1alpha.StatsResponse)
io.grpc.instrumentation.v1alpha.StatsResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_StatsResponse_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_StatsResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.instrumentation.v1alpha.StatsResponse.class, io.grpc.instrumentation.v1alpha.StatsResponse.Builder.class);
}
// Construct using io.grpc.instrumentation.v1alpha.StatsResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_StatsResponse_descriptor;
}
public io.grpc.instrumentation.v1alpha.StatsResponse getDefaultInstanceForType() {
return io.grpc.instrumentation.v1alpha.StatsResponse.getDefaultInstance();
}
public io.grpc.instrumentation.v1alpha.StatsResponse build() {
io.grpc.instrumentation.v1alpha.StatsResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.instrumentation.v1alpha.StatsResponse buildPartial() {
io.grpc.instrumentation.v1alpha.StatsResponse result = new io.grpc.instrumentation.v1alpha.StatsResponse(this);
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.instrumentation.v1alpha.StatsResponse) {
return mergeFrom((io.grpc.instrumentation.v1alpha.StatsResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.instrumentation.v1alpha.StatsResponse other) {
if (other == io.grpc.instrumentation.v1alpha.StatsResponse.getDefaultInstance()) return this;
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.instrumentation.v1alpha.StatsResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.instrumentation.v1alpha.StatsResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:grpc.instrumentation.v1alpha.StatsResponse)
}
// @@protoc_insertion_point(class_scope:grpc.instrumentation.v1alpha.StatsResponse)
private static final io.grpc.instrumentation.v1alpha.StatsResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.instrumentation.v1alpha.StatsResponse();
}
public static io.grpc.instrumentation.v1alpha.StatsResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<StatsResponse>
PARSER = new com.google.protobuf.AbstractParser<StatsResponse>() {
public StatsResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new StatsResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<StatsResponse> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<StatsResponse> getParserForType() {
return PARSER;
}
public io.grpc.instrumentation.v1alpha.StatsResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -0,0 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
public interface StatsResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:grpc.instrumentation.v1alpha.StatsResponse)
com.google.protobuf.MessageOrBuilder {
}

View File

@ -0,0 +1,374 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
/**
* <pre>
* TODO(aveitch): Complete definition of this type
* </pre>
*
* Protobuf type {@code grpc.instrumentation.v1alpha.TraceRequest}
*/
public final class TraceRequest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:grpc.instrumentation.v1alpha.TraceRequest)
TraceRequestOrBuilder {
// Use TraceRequest.newBuilder() to construct.
private TraceRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private TraceRequest() {
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private TraceRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_TraceRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_TraceRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.instrumentation.v1alpha.TraceRequest.class, io.grpc.instrumentation.v1alpha.TraceRequest.Builder.class);
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.grpc.instrumentation.v1alpha.TraceRequest)) {
return super.equals(obj);
}
io.grpc.instrumentation.v1alpha.TraceRequest other = (io.grpc.instrumentation.v1alpha.TraceRequest) obj;
boolean result = true;
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grpc.instrumentation.v1alpha.TraceRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.instrumentation.v1alpha.TraceRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.TraceRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.instrumentation.v1alpha.TraceRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.TraceRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.TraceRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.TraceRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.TraceRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.TraceRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.TraceRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.instrumentation.v1alpha.TraceRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* TODO(aveitch): Complete definition of this type
* </pre>
*
* Protobuf type {@code grpc.instrumentation.v1alpha.TraceRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:grpc.instrumentation.v1alpha.TraceRequest)
io.grpc.instrumentation.v1alpha.TraceRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_TraceRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_TraceRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.instrumentation.v1alpha.TraceRequest.class, io.grpc.instrumentation.v1alpha.TraceRequest.Builder.class);
}
// Construct using io.grpc.instrumentation.v1alpha.TraceRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_TraceRequest_descriptor;
}
public io.grpc.instrumentation.v1alpha.TraceRequest getDefaultInstanceForType() {
return io.grpc.instrumentation.v1alpha.TraceRequest.getDefaultInstance();
}
public io.grpc.instrumentation.v1alpha.TraceRequest build() {
io.grpc.instrumentation.v1alpha.TraceRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.instrumentation.v1alpha.TraceRequest buildPartial() {
io.grpc.instrumentation.v1alpha.TraceRequest result = new io.grpc.instrumentation.v1alpha.TraceRequest(this);
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.instrumentation.v1alpha.TraceRequest) {
return mergeFrom((io.grpc.instrumentation.v1alpha.TraceRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.instrumentation.v1alpha.TraceRequest other) {
if (other == io.grpc.instrumentation.v1alpha.TraceRequest.getDefaultInstance()) return this;
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.instrumentation.v1alpha.TraceRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.instrumentation.v1alpha.TraceRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:grpc.instrumentation.v1alpha.TraceRequest)
}
// @@protoc_insertion_point(class_scope:grpc.instrumentation.v1alpha.TraceRequest)
private static final io.grpc.instrumentation.v1alpha.TraceRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.instrumentation.v1alpha.TraceRequest();
}
public static io.grpc.instrumentation.v1alpha.TraceRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<TraceRequest>
PARSER = new com.google.protobuf.AbstractParser<TraceRequest>() {
public TraceRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TraceRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<TraceRequest> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<TraceRequest> getParserForType() {
return PARSER;
}
public io.grpc.instrumentation.v1alpha.TraceRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -0,0 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
public interface TraceRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:grpc.instrumentation.v1alpha.TraceRequest)
com.google.protobuf.MessageOrBuilder {
}

View File

@ -0,0 +1,374 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
/**
* <pre>
* TODO(aveitch): Complete definition of this type
* </pre>
*
* Protobuf type {@code grpc.instrumentation.v1alpha.TraceResponse}
*/
public final class TraceResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:grpc.instrumentation.v1alpha.TraceResponse)
TraceResponseOrBuilder {
// Use TraceResponse.newBuilder() to construct.
private TraceResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private TraceResponse() {
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private TraceResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_TraceResponse_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_TraceResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.instrumentation.v1alpha.TraceResponse.class, io.grpc.instrumentation.v1alpha.TraceResponse.Builder.class);
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.grpc.instrumentation.v1alpha.TraceResponse)) {
return super.equals(obj);
}
io.grpc.instrumentation.v1alpha.TraceResponse other = (io.grpc.instrumentation.v1alpha.TraceResponse) obj;
boolean result = true;
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grpc.instrumentation.v1alpha.TraceResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.instrumentation.v1alpha.TraceResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.TraceResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.instrumentation.v1alpha.TraceResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.TraceResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.TraceResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.TraceResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.TraceResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.instrumentation.v1alpha.TraceResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.instrumentation.v1alpha.TraceResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.instrumentation.v1alpha.TraceResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* TODO(aveitch): Complete definition of this type
* </pre>
*
* Protobuf type {@code grpc.instrumentation.v1alpha.TraceResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:grpc.instrumentation.v1alpha.TraceResponse)
io.grpc.instrumentation.v1alpha.TraceResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_TraceResponse_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_TraceResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.instrumentation.v1alpha.TraceResponse.class, io.grpc.instrumentation.v1alpha.TraceResponse.Builder.class);
}
// Construct using io.grpc.instrumentation.v1alpha.TraceResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.instrumentation.v1alpha.MonitoringProto.internal_static_grpc_instrumentation_v1alpha_TraceResponse_descriptor;
}
public io.grpc.instrumentation.v1alpha.TraceResponse getDefaultInstanceForType() {
return io.grpc.instrumentation.v1alpha.TraceResponse.getDefaultInstance();
}
public io.grpc.instrumentation.v1alpha.TraceResponse build() {
io.grpc.instrumentation.v1alpha.TraceResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.instrumentation.v1alpha.TraceResponse buildPartial() {
io.grpc.instrumentation.v1alpha.TraceResponse result = new io.grpc.instrumentation.v1alpha.TraceResponse(this);
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.instrumentation.v1alpha.TraceResponse) {
return mergeFrom((io.grpc.instrumentation.v1alpha.TraceResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.instrumentation.v1alpha.TraceResponse other) {
if (other == io.grpc.instrumentation.v1alpha.TraceResponse.getDefaultInstance()) return this;
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.instrumentation.v1alpha.TraceResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.instrumentation.v1alpha.TraceResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:grpc.instrumentation.v1alpha.TraceResponse)
}
// @@protoc_insertion_point(class_scope:grpc.instrumentation.v1alpha.TraceResponse)
private static final io.grpc.instrumentation.v1alpha.TraceResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.instrumentation.v1alpha.TraceResponse();
}
public static io.grpc.instrumentation.v1alpha.TraceResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<TraceResponse>
PARSER = new com.google.protobuf.AbstractParser<TraceResponse>() {
public TraceResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TraceResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<TraceResponse> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<TraceResponse> getParserForType() {
return PARSER;
}
public io.grpc.instrumentation.v1alpha.TraceResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -0,0 +1,9 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/instrumentation/v1alpha/monitoring.proto
package io.grpc.instrumentation.v1alpha;
public interface TraceResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:grpc.instrumentation.v1alpha.TraceResponse)
com.google.protobuf.MessageOrBuilder {
}

View File

@ -0,0 +1,111 @@
/*
* Copyright 2017, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package io.grpc.services;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.annotations.VisibleForTesting;
import com.google.instrumentation.stats.RpcConstants;
import com.google.instrumentation.stats.Stats;
import com.google.instrumentation.stats.StatsManager;
import com.google.protobuf.Empty;
import io.grpc.ExperimentalApi;
import io.grpc.instrumentation.v1alpha.CanonicalRpcStats;
import io.grpc.instrumentation.v1alpha.MonitoringGrpc;
import io.grpc.stub.StreamObserver;
/**
* An implementation of the gRPC monitoring service.
*
* <p>An implementation of {@link StatsManager} must be available at runtime (determined via {@link
* Stats#getStatsManager}) or instantiating this service will fail.
*/
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/2776")
public final class MonitoringService extends MonitoringGrpc.MonitoringImplBase {
private static MonitoringService instance;
private final StatsManager statsManager;
@VisibleForTesting
MonitoringService(StatsManager statsManager) {
checkNotNull(statsManager, "StatsManager implementation unavailable");
this.statsManager = statsManager;
}
/**
* Gets the singleton instance of the MonitoringService.
*
* @throws IllegalStateException if {@link Stats#getStatsManager} returns null
*/
public static synchronized MonitoringService getInstance() {
if (instance == null) {
instance = new MonitoringService(Stats.getStatsManager());
}
return instance;
}
// TODO(ericgribkoff) Add remaining CanonicalRpcStats fields when they are included in
// instrumentation.
@Override
public void getCanonicalRpcStats(
Empty request, StreamObserver<CanonicalRpcStats> responseObserver) {
CanonicalRpcStats response =
CanonicalRpcStats.newBuilder()
.setRpcClientElapsedTime(
MonitoringUtil.buildCanonicalRpcStatsView(
statsManager.getView(RpcConstants.RPC_CLIENT_ROUNDTRIP_LATENCY_VIEW)))
.setRpcClientServerElapsedTime(
MonitoringUtil.buildCanonicalRpcStatsView(
statsManager.getView(RpcConstants.RPC_CLIENT_SERVER_ELAPSED_TIME_VIEW)))
.setRpcClientRequestBytes(
MonitoringUtil.buildCanonicalRpcStatsView(
statsManager.getView(RpcConstants.RPC_CLIENT_REQUEST_BYTES_VIEW)))
.setRpcClientResponseBytes(
MonitoringUtil.buildCanonicalRpcStatsView(
statsManager.getView(RpcConstants.RPC_CLIENT_RESPONSE_BYTES_VIEW)))
.setRpcServerServerElapsedTime(
MonitoringUtil.buildCanonicalRpcStatsView(
statsManager.getView(RpcConstants.RPC_SERVER_SERVER_LATENCY_VIEW)))
.setRpcServerRequestBytes(
MonitoringUtil.buildCanonicalRpcStatsView(
statsManager.getView(RpcConstants.RPC_SERVER_REQUEST_BYTES_VIEW)))
.setRpcServerResponseBytes(
MonitoringUtil.buildCanonicalRpcStatsView(
statsManager.getView(RpcConstants.RPC_SERVER_RESPONSE_BYTES_VIEW)))
.setRpcServerElapsedTime(
MonitoringUtil.buildCanonicalRpcStatsView(
statsManager.getView(RpcConstants.RPC_SERVER_SERVER_ELAPSED_TIME_VIEW)))
.build();
responseObserver.onNext(response);
responseObserver.onCompleted();
}
}

View File

@ -0,0 +1,276 @@
/*
* Copyright 2017, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package io.grpc.services;
import com.google.common.annotations.VisibleForTesting;
import com.google.instrumentation.common.Duration;
import com.google.instrumentation.common.Timestamp;
import com.google.instrumentation.stats.DistributionAggregation;
import com.google.instrumentation.stats.DistributionAggregationDescriptor;
import com.google.instrumentation.stats.IntervalAggregation;
import com.google.instrumentation.stats.IntervalAggregation.Interval;
import com.google.instrumentation.stats.IntervalAggregationDescriptor;
import com.google.instrumentation.stats.MeasurementDescriptor;
import com.google.instrumentation.stats.MeasurementDescriptor.BasicUnit;
import com.google.instrumentation.stats.MeasurementDescriptor.MeasurementUnit;
import com.google.instrumentation.stats.Tag;
import com.google.instrumentation.stats.TagKey;
import com.google.instrumentation.stats.View;
import com.google.instrumentation.stats.View.DistributionView;
import com.google.instrumentation.stats.View.IntervalView;
import com.google.instrumentation.stats.ViewDescriptor;
import com.google.instrumentation.stats.ViewDescriptor.DistributionViewDescriptor;
import com.google.instrumentation.stats.ViewDescriptor.IntervalViewDescriptor;
import com.google.instrumentation.stats.proto.CensusProto;
import io.grpc.ExperimentalApi;
import io.grpc.instrumentation.v1alpha.CanonicalRpcStats;
/** Utility methods to support {@link MonitoringService}. */
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/2776")
final class MonitoringUtil {
private MonitoringUtil() {}
/** Serialize a {@link View} and associated descriptors to a {@link CanonicalRpcStats.View}. */
static CanonicalRpcStats.View buildCanonicalRpcStatsView(View view) {
return CanonicalRpcStats.View.newBuilder()
.setMeasurementDescriptor(
serializeMeasurementDescriptor(view.getViewDescriptor().getMeasurementDescriptor()))
.setViewDescriptor(serializeViewDescriptor(view.getViewDescriptor()))
.setView(serializeView(view))
.build();
}
@VisibleForTesting
static CensusProto.MeasurementDescriptor serializeMeasurementDescriptor(
MeasurementDescriptor measurementDescriptor) {
return CensusProto.MeasurementDescriptor.newBuilder()
.setName(measurementDescriptor.getName())
.setDescription(measurementDescriptor.getDescription())
.setUnit(serializeMeasurementUnit(measurementDescriptor.getUnit()))
.build();
}
@VisibleForTesting
static CensusProto.MeasurementDescriptor.MeasurementUnit serializeMeasurementUnit(
MeasurementUnit unit) {
CensusProto.MeasurementDescriptor.MeasurementUnit.Builder unitBuilder =
CensusProto.MeasurementDescriptor.MeasurementUnit.newBuilder()
.setPower10(unit.getPower10());
for (BasicUnit basicUnit : unit.getNumerators()) {
unitBuilder.addNumerators(serializeBasicUnit(basicUnit));
}
for (BasicUnit basicUnit : unit.getDenominators()) {
unitBuilder.addDenominators(serializeBasicUnit(basicUnit));
}
return unitBuilder.build();
}
@VisibleForTesting
static CensusProto.MeasurementDescriptor.BasicUnit serializeBasicUnit(BasicUnit basicUnit) {
switch (basicUnit) {
case SCALAR:
return CensusProto.MeasurementDescriptor.BasicUnit.SCALAR;
case BITS:
return CensusProto.MeasurementDescriptor.BasicUnit.BITS;
case BYTES:
return CensusProto.MeasurementDescriptor.BasicUnit.BYTES;
case SECONDS:
return CensusProto.MeasurementDescriptor.BasicUnit.SECONDS;
case CORES:
return CensusProto.MeasurementDescriptor.BasicUnit.CORES;
default:
return CensusProto.MeasurementDescriptor.BasicUnit.UNKNOWN;
}
}
@VisibleForTesting
static CensusProto.ViewDescriptor serializeViewDescriptor(ViewDescriptor viewDescriptor) {
CensusProto.ViewDescriptor.Builder viewDescriptorBuilder =
CensusProto.ViewDescriptor.newBuilder()
.setName(viewDescriptor.getName())
.setDescription(viewDescriptor.getDescription())
.setMeasurementDescriptorName(viewDescriptor.getMeasurementDescriptor().getName());
for (TagKey tagKey : viewDescriptor.getTagKeys()) {
viewDescriptorBuilder.addTagKeys(tagKey.toString());
}
if (viewDescriptor instanceof DistributionViewDescriptor) {
viewDescriptorBuilder.setDistributionAggregation(
serializeDistributionAggregationDescriptor(
((DistributionViewDescriptor) viewDescriptor)
.getDistributionAggregationDescriptor()));
} else {
viewDescriptorBuilder.setIntervalAggregation(
serializeIntervalAggregationDescriptor(
((IntervalViewDescriptor) viewDescriptor).getIntervalAggregationDescriptor()));
}
return viewDescriptorBuilder.build();
}
@VisibleForTesting
static CensusProto.DistributionAggregationDescriptor serializeDistributionAggregationDescriptor(
DistributionAggregationDescriptor distributionAggregationDescriptor) {
CensusProto.DistributionAggregationDescriptor.Builder distributionAggregationDescriptorBuilder =
CensusProto.DistributionAggregationDescriptor.newBuilder();
if (distributionAggregationDescriptor.getBucketBoundaries() != null) {
distributionAggregationDescriptorBuilder.addAllBucketBounds(
distributionAggregationDescriptor.getBucketBoundaries());
}
return distributionAggregationDescriptorBuilder.build();
}
@VisibleForTesting
static CensusProto.IntervalAggregationDescriptor serializeIntervalAggregationDescriptor(
IntervalAggregationDescriptor intervalAggregationDescriptor) {
CensusProto.IntervalAggregationDescriptor.Builder intervalAggregationDescriptorBuilder =
CensusProto.IntervalAggregationDescriptor.newBuilder()
.setNSubIntervals(intervalAggregationDescriptor.getNumSubIntervals());
for (Duration intervalSize : intervalAggregationDescriptor.getIntervalSizes()) {
intervalAggregationDescriptorBuilder.addIntervalSizes(serializeDuration(intervalSize));
}
return intervalAggregationDescriptorBuilder.build();
}
@VisibleForTesting
static CensusProto.Duration serializeDuration(Duration duration) {
return CensusProto.Duration.newBuilder()
.setSeconds(duration.getSeconds())
.setNanos(duration.getNanos())
.build();
}
@VisibleForTesting
static CensusProto.View serializeView(View view) {
CensusProto.View.Builder viewBuilder =
CensusProto.View.newBuilder().setViewName(view.getViewDescriptor().getName());
if (view instanceof DistributionView) {
viewBuilder.setDistributionView(serializeDistributionView((DistributionView) view));
} else {
viewBuilder.setIntervalView(serializeIntervalView((IntervalView) view));
}
return viewBuilder.build();
}
@VisibleForTesting
static CensusProto.DistributionView serializeDistributionView(DistributionView distributionView) {
CensusProto.DistributionView.Builder distributionViewBuilder =
CensusProto.DistributionView.newBuilder();
//TODO(ericgribkoff) Re-enable once getter methods are public in instrumentation.
//distributionViewBuilder.setStart(serializeTimestamp(distributionView.getStart()))
//distributionViewBuilder.setEnd(serializeTimestamp(distributionView.getEnd()));
for (DistributionAggregation aggregation : distributionView.getDistributionAggregations()) {
distributionViewBuilder.addAggregations(serializeDistributionAggregation(aggregation));
}
return distributionViewBuilder.build();
}
@VisibleForTesting
static CensusProto.Timestamp serializeTimestamp(Timestamp timestamp) {
return CensusProto.Timestamp.newBuilder()
.setSeconds(timestamp.getSeconds())
.setNanos(timestamp.getNanos())
.build();
}
@VisibleForTesting
static CensusProto.DistributionAggregation serializeDistributionAggregation(
DistributionAggregation aggregation) {
CensusProto.DistributionAggregation.Builder aggregationBuilder =
CensusProto.DistributionAggregation.newBuilder()
.setCount(aggregation.getCount())
.setMean(aggregation.getMean())
.setSum(aggregation.getSum())
.setRange(serializeRange(aggregation.getRange()));
if (aggregation.getBucketCounts() != null) {
aggregationBuilder.addAllBucketCounts(aggregation.getBucketCounts());
}
for (Tag tag : aggregation.getTags()) {
aggregationBuilder.addTags(serializeTag(tag));
}
return aggregationBuilder.build();
}
@VisibleForTesting
static CensusProto.DistributionAggregation.Range serializeRange(
DistributionAggregation.Range range) {
CensusProto.DistributionAggregation.Range.Builder builder =
CensusProto.DistributionAggregation.Range.newBuilder();
if (range != null) {
builder.setMin(range.getMin()).setMax(range.getMax());
}
return builder.build();
}
@VisibleForTesting
static CensusProto.Tag serializeTag(Tag tag) {
return CensusProto.Tag.newBuilder()
.setKey(tag.getKey().toString())
.setValue(tag.getValue().toString())
.build();
}
@VisibleForTesting
static CensusProto.IntervalView serializeIntervalView(IntervalView intervalView) {
CensusProto.IntervalView.Builder intervalViewBuilder = CensusProto.IntervalView.newBuilder();
for (IntervalAggregation aggregation : intervalView.getIntervalAggregations()) {
intervalViewBuilder.addAggregations(serializeIntervalAggregation(aggregation));
}
return intervalViewBuilder.build();
}
@VisibleForTesting
static CensusProto.IntervalAggregation serializeIntervalAggregation(
IntervalAggregation aggregation) {
CensusProto.IntervalAggregation.Builder aggregationBuilder =
CensusProto.IntervalAggregation.newBuilder();
for (Interval interval : aggregation.getIntervals()) {
aggregationBuilder.addIntervals(serializeInterval(interval));
}
for (Tag tag : aggregation.getTags()) {
aggregationBuilder.addTags(serializeTag(tag));
}
return aggregationBuilder.build();
}
@VisibleForTesting
static CensusProto.IntervalAggregation.Interval serializeInterval(Interval interval) {
return CensusProto.IntervalAggregation.Interval.newBuilder()
.setIntervalSize(serializeDuration(interval.getIntervalSize()))
.setCount(interval.getCount())
.setSum(interval.getSum())
.build();
}
}

View File

@ -0,0 +1,317 @@
// Copyright 2017, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This is copied from https://github.com/google/instrumentation-proto/.
// TODO(ericgribkoff) Sync this proto with grpc/grpc-proto.
syntax = "proto3";
package google.instrumentation;
option java_package = "com.google.instrumentation.stats.proto";
option java_outer_classname = "CensusProto";
// All the census protos.
//
// Nomenclature notes:
// * Capitalized names below (like View) are protos.
// * Protos which describe types are named with a Descriptor suffix (e.g.
// MesurementDescriptor).
//
// Census lets you define the type and description of the data being measured
// (e.g. the latency of an RPC or the number of CPU cycles spent on an
// operation using MeasurementDescriptor. As individual measurements (a double
// value) for are recorded, they are aggregated together into an
// Aggregation. There are two Aggregation types available: Distribution
// (describes the distribution of all measurements, possibly with a histogram)
// and IntervalStats (the count and mean of measurements across specified time
// periods). An Aggregation is described by an AggregationDescriptor.
//
// You can define how your measurements (described by a MeasurementDescriptor)
// are broken down by Tag values and which Aggregations to use through a
// ViewDescriptor. The output (all measurements broken down by tag values into
// specific Aggregations) is called a View.
// The following two types are copied from
// google/protobuf/{duration,timestamp}.proto. Ideally, we would be able to
// import them, but this causes compilation issues on C-based systems
// (e.g. https://koti.kapsi.fi/jpa/nanopb/), which cannot process the C++
// headers generated from the standard protobuf distribution. See the relevant
// proto files for full documentation of these types.
message Duration {
// Signed seconds of the span of time. Must be from -315,576,000,000
// to +315,576,000,000 inclusive.
int64 seconds = 1;
// Signed fractions of a second at nanosecond resolution of the span
// of time. Durations less than one second are represented with a 0
// `seconds` field and a positive or negative `nanos` field. For durations
// of one second or more, a non-zero value for the `nanos` field must be
// of the same sign as the `seconds` field. Must be from -999,999,999
// to +999,999,999 inclusive.
int32 nanos = 2;
}
message Timestamp {
// Represents seconds of UTC time since Unix epoch
// 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
// 9999-12-31T23:59:59Z inclusive.
int64 seconds = 1;
// Non-negative fractions of a second at nanosecond resolution. Negative
// second values with fractions must still have non-negative nanos values
// that count forward in time. Must be from 0 to 999,999,999
// inclusive.
int32 nanos = 2;
}
// MeasurementDescriptor describes a data point (measurement) type.
message MeasurementDescriptor {
// A descriptive name, e.g. rpc_latency, cpu. Must be unique.
string name = 1;
// More detailed description of the resource, used in documentation.
string description = 2;
// Fundamental units of measurement supported by Census
// TODO(aveitch): expand this to include other S.I. units?
enum BasicUnit {
UNKNOWN = 0; // Implementations should not use this
SCALAR = 1; // Dimensionless
BITS = 2; // A single bit
BYTES = 3; // An 8-bit byte
SECONDS = 4; // S.I. unit
CORES = 5; // CPU core usage
MAX_UNITS = 6; // Last defined value; implementations should only use
// this for validation.
}
// MeasurementUnit lets you build compound units of the form
// 10^n * (A * B * ...) / (X * Y * ...),
// where the elements in the numerator and denominator are all BasicUnits. A
// MeasurementUnit must have at least one BasicUnit in its numerator.
//
// To specify multiplication in the numerator or denominator, simply specify
// multiple numerator or denominator fields. For example:
//
// - byte-seconds (i.e. bytes * seconds):
// numerator: BYTES
// numerator: SECS
//
// - events/sec^2 (i.e. rate of change of events/sec):
// numerator: SCALAR
// denominator: SECS
// denominator: SECS
//
// To specify multiples (in power of 10) of units, specify a non-zero
// 'power10' value, for example:
//
// - MB/s (i.e. megabytes / s):
// power10: 6
// numerator: BYTES
// denominator: SECS
//
// - nanoseconds
// power10: -9
// numerator: SECS
message MeasurementUnit {
int32 power10 = 1;
repeated BasicUnit numerators = 2;
repeated BasicUnit denominators = 3;
}
// The units used by this type of measurement.
MeasurementUnit unit = 3;
}
// An aggregation summarizes a series of individual measurements. There are
// two types of aggregation (IntervalAggregation and DistributionAggregation),
// unique types of each can be set using descriptors for each.
// DistributionAggregation contains summary statistics for a population of
// values and, optionally, a histogram representing the distribution of those
// values across a specified set of histogram buckets, as defined in
// DistributionAggregationDescriptor.bucket_bounds.
//
// The summary statistics are the count, mean, minimum, and the maximum of the
// set of population of values.
//
// Although it is not forbidden, it is generally a bad idea to include
// non-finite values (infinities or NaNs) in the population of values, as this
// will render the `mean` field meaningless.
message DistributionAggregation {
// The number of values in the population. Must be non-negative.
int64 count = 1;
// The arithmetic mean of the values in the population. If `count` is zero
// then this field must be zero.
double mean = 2;
// The sum of the values in the population. If `count` is zero then this
// field must be zero.
double sum = 3;
// Describes a range of population values.
message Range {
// The minimum of the population values.
double min = 1;
// The maximum of the population values.
double max = 2;
}
// The range of the population values. If `count` is zero, this field will not
// be defined.
Range range = 4;
// A Distribution may optionally contain a histogram of the values in the
// population. The histogram is given in `bucket_count` as counts of values
// that fall into one of a sequence of non-overlapping buckets, as described
// by `DistributionAggregationDescriptor.bucket_boundaries`. The sum of the
// values in `bucket_counts` must equal the value in `count`.
//
// Bucket counts are given in order under the numbering scheme described
// above (the underflow bucket has number 0; the finite buckets, if any,
// have numbers 1 through N-2; the overflow bucket has number N-1).
//
// The size of `bucket_count` must be no greater than N as defined in
// `bucket_boundaries`.
//
// Any suffix of trailing zero bucket_count fields may be omitted.
repeated int64 bucket_counts = 5;
// Tags associated with this DistributionAggregation. These will be filled
// in based on the View specification.
repeated Tag tags = 6;
}
message DistributionAggregationDescriptor {
// A Distribution may optionally contain a histogram of the values in the
// population. The bucket boundaries for that histogram are described by
// `bucket_bounds`. This defines `size(bucket_bounds) + 1` (= N)
// buckets. The boundaries for bucket index i are:
//
// [-infinity, bucket_bounds[i]) for i == 0
// [bucket_bounds[i-1], bucket_bounds[i]) for 0 < i < N-2
// [bucket_bounds[i-1], +infinity) for i == N-1
//
// i.e. an underflow bucket (number 0), zero or more finite buckets (1
// through N - 2, and an overflow bucket (N - 1), with inclusive lower
// bounds and exclusive upper bounds.
//
// If `bucket_bounds` has no elements (zero size), then there is no
// histogram associated with the Distribution. If `bucket_bounds` has only
// one element, there are no finite buckets, and that single element is the
// common boundary of the overflow and underflow buckets. The values must
// be monotonically increasing.
repeated double bucket_bounds = 1;
}
// An IntervalAggreation records summary stats over various time
// windows. These stats are approximate, with the degree of accuracy
// controlled by setting the n_sub_intervals parameter in the
// IntervalAggregationDescriptor.
message IntervalAggregation {
// Summary statistic over a single time interval.
message Interval {
// The interval duration. Must be positive.
Duration interval_size = 1;
// Approximate number of measurements recorded in this interval.
double count = 2;
// The cumulative sum of measurements in this interval.
double sum = 3;
}
// Full set of intervals for this aggregation.
repeated Interval intervals = 1;
// Tags associated with this IntervalAggregation. These will be filled in
// based on the View specification.
repeated Tag tags = 2;
}
// An IntervalAggreationDescriptor specifies time intervals for an
// IntervalAggregation.
message IntervalAggregationDescriptor {
// Number of internal sub-intervals to use when collecting stats for each
// interval. The max error in interval measurements will be approximately
// 1/n_sub_intervals (although in practice, this will only be approached in
// the presence of very large and bursty workload changes), and underlying
// memory usage will be roughly proportional to the value of this
// field. Must be in the range [2, 20]. A value of 5 will be used if this is
// unspecified.
int32 n_sub_intervals = 1;
// The size of each interval, as a time duration. Must have at least one
// element.
repeated Duration interval_sizes = 2;
}
// A Tag: key-value pair.
message Tag {
string key = 1;
string value = 2;
}
// A ViewDescriptor specifies an AggregationDescriptor and a set of tag
// keys. Views instantiated from this descriptor will contain Aggregations
// broken down by the unique set of matching tag values for each measurement.
message ViewDescriptor {
// Name of view. Must be unique.
string name = 1;
// More detailed description, for documentation purposes.
string description = 2;
// Name of a MeasurementDescriptor to be used for this view.
string measurement_descriptor_name = 3;
// Aggregation type to associate with View.
oneof aggregation {
IntervalAggregationDescriptor interval_aggregation = 4;
DistributionAggregationDescriptor distribution_aggregation = 5;
}
// Tag keys to match with a given measurement. If no keys are specified,
// then all stats are recorded. Keys must be unique.
repeated string tag_keys = 6;
}
// DistributionView contains all aggregations for a view specified using a
// DistributionAggregationDescriptor.
message DistributionView {
// Aggregations - each will have a unique set of tag values for the tag_keys
// associated with the corresponding View.
repeated DistributionAggregation aggregations = 1;
// Start and end timestamps over which aggregations was accumulated.
Timestamp start = 2;
Timestamp end = 3;
}
// IntervalView contains all aggregations for a view specified using a
// IntervalAggregationDescriptor.
message IntervalView {
// Aggregations - each will have a unique set of tag values for the tag_keys
// associated with the corresponding View.
repeated IntervalAggregation aggregations = 1;
}
// A View contains the aggregations based on a ViewDescriptor.
message View {
// ViewDescriptor name associated with this set of View.
string view_name = 1;
oneof view {
DistributionView distribution_view = 2;
IntervalView interval_view = 3;
}
}

View File

@ -0,0 +1,131 @@
// Copyright 2017, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This file defines an interface for exporting monitoring information
// out of gRPC servers.
syntax = "proto3";
// TODO(ericgribkoff) Figure out how to manage the external Census proto
// dependency.
import "google/instrumentation/census.proto";
import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
package grpc.instrumentation.v1alpha;
option java_multiple_files = true;
option java_package = "io.grpc.instrumentation.v1alpha";
option java_outer_classname = "MonitoringProto";
service Monitoring {
// Return canonical RPC stats
rpc GetCanonicalRpcStats(google.protobuf.Empty) returns (CanonicalRpcStats) {
}
// Query the server for specific stats
rpc GetStats(StatsRequest) returns (StatsResponse) {
// TODO(aveitch, ericgribkoff): Pease define the stats response message
// StatsRequest would specifically identify the stats to be returned.
}
// Request the server to stream back snapshots of the requested stats
rpc WatchStats(StatsRequest) returns (stream StatsResponse) {
}
// Return request traces.
rpc GetRequestTraces(TraceRequest) returns(TraceResponse) {
// TODO(aveitch): Please define the messages here
}
// Return application-defined groups of monitoring data.
// This is a low level facility to allow extension of the monitoring API to
// application-specific monitoring data. Frameworks may use this to define
// additional groups of monitoring data made available by servers.
rpc GetCustomMonitoringData(MonitoringDataGroup)
returns (CustomMonitoringData) {
}
}
// Canonical RPC stats exported by gRPC.
message CanonicalRpcStats {
// Wrapper combining View and ViewDescriptor.
message View {
google.instrumentation.MeasurementDescriptor measurement_descriptor = 1;
google.instrumentation.ViewDescriptor view_descriptor = 2;
google.instrumentation.View view = 3;
}
View rpc_client_errors = 1;
View rpc_client_completed_rpcs = 2;
View rpc_client_started_rpcs = 3;
View rpc_client_elapsed_time = 4;
View rpc_client_server_elapsed_time = 5;
View rpc_client_request_bytes = 6;
View rpc_client_response_bytes = 7;
View rpc_client_request_count = 8;
View rpc_client_response_count = 9;
View rpc_server_errors = 10;
View rpc_server_completed_rpcs = 11;
View rpc_server_server_elapsed_time = 12;
View rpc_server_request_bytes = 13;
View rpc_server_response_bytes = 14;
View rpc_server_request_count = 15;
View rpc_server_response_count = 16;
View rpc_server_elapsed_time = 17;
//TODO(ericgribkoff) Add minute-hour interval stats.
}
message StatsRequest {
// TODO(aveitch): Complete definition of this type
}
message StatsResponse {
// TODO(aveitch): Complete definition of this type
}
message TraceRequest {
// TODO(aveitch): Complete definition of this type
}
message TraceResponse {
// TODO(aveitch): Complete definition of this type
}
message MonitoringDataGroup {
string name = 1; // name of a group of monitoring data
}
// The wrapper for custom monitoring data.
message CustomMonitoringData {
// can be any application specific monitoring data
google.protobuf.Any contents = 1;
}

View File

@ -0,0 +1,117 @@
/*
* Copyright 2017, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package io.grpc.services;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import com.google.instrumentation.stats.RpcConstants;
import com.google.instrumentation.stats.StatsManager;
import com.google.instrumentation.stats.View;
import com.google.instrumentation.stats.ViewDescriptor.DistributionViewDescriptor;
import com.google.instrumentation.stats.ViewDescriptor.IntervalViewDescriptor;
import com.google.protobuf.Empty;
import io.grpc.instrumentation.v1alpha.CanonicalRpcStats;
import io.grpc.stub.StreamObserver;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
/** Unit tests for {@link MonitoringService}. */
@RunWith(JUnit4.class)
public class MonitoringServiceTest {
@Mock private StatsManager statsManager;
@Captor private ArgumentCaptor<StreamObserver<CanonicalRpcStats>> responseObserverCaptor;
private MonitoringService monitoringService;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
View view = mock(View.class);
when(statsManager.getView(any(DistributionViewDescriptor.class)))
.thenReturn(MonitoringUtilTest.DISTRIBUTION_VIEW);
when(statsManager.getView(any(IntervalViewDescriptor.class)))
.thenReturn(MonitoringUtilTest.INTERVAL_VIEW);
monitoringService = new MonitoringService(statsManager);
}
@Test
public void getCanonicalRpcStats() throws Exception {
@SuppressWarnings("unchecked")
StreamObserver<CanonicalRpcStats> observer = mock(StreamObserver.class);
ArgumentCaptor<CanonicalRpcStats> statsResponse =
ArgumentCaptor.forClass(CanonicalRpcStats.class);
monitoringService.getCanonicalRpcStats(Empty.getDefaultInstance(), observer);
verify(statsManager).getView(RpcConstants.RPC_CLIENT_ROUNDTRIP_LATENCY_VIEW);
verify(statsManager).getView(RpcConstants.RPC_CLIENT_SERVER_ELAPSED_TIME_VIEW);
verify(statsManager).getView(RpcConstants.RPC_CLIENT_REQUEST_BYTES_VIEW);
verify(statsManager).getView(RpcConstants.RPC_CLIENT_RESPONSE_BYTES_VIEW);
verify(statsManager).getView(RpcConstants.RPC_SERVER_SERVER_LATENCY_VIEW);
verify(statsManager).getView(RpcConstants.RPC_SERVER_REQUEST_BYTES_VIEW);
verify(statsManager).getView(RpcConstants.RPC_SERVER_RESPONSE_BYTES_VIEW);
verify(statsManager).getView(RpcConstants.RPC_SERVER_SERVER_ELAPSED_TIME_VIEW);
verifyNoMoreInteractions(statsManager);
verify(observer).onNext(statsResponse.capture());
assertFalse(statsResponse.getValue().hasRpcClientErrors());
assertFalse(statsResponse.getValue().hasRpcClientCompletedRpcs());
assertFalse(statsResponse.getValue().hasRpcClientStartedRpcs());
assertTrue(statsResponse.getValue().hasRpcClientElapsedTime());
assertTrue(statsResponse.getValue().hasRpcClientServerElapsedTime());
assertTrue(statsResponse.getValue().hasRpcClientRequestBytes());
assertTrue(statsResponse.getValue().hasRpcClientResponseBytes());
assertFalse(statsResponse.getValue().hasRpcClientRequestCount());
assertFalse(statsResponse.getValue().hasRpcClientResponseCount());
assertFalse(statsResponse.getValue().hasRpcServerErrors());
assertFalse(statsResponse.getValue().hasRpcServerCompletedRpcs());
assertTrue(statsResponse.getValue().hasRpcServerServerElapsedTime());
assertTrue(statsResponse.getValue().hasRpcServerRequestBytes());
assertTrue(statsResponse.getValue().hasRpcServerResponseBytes());
assertFalse(statsResponse.getValue().hasRpcServerRequestCount());
assertFalse(statsResponse.getValue().hasRpcServerResponseCount());
assertTrue(statsResponse.getValue().hasRpcServerElapsedTime());
}
}

View File

@ -0,0 +1,365 @@
/*
* Copyright 2017, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package io.grpc.services;
import static org.junit.Assert.assertEquals;
import com.google.instrumentation.common.Duration;
import com.google.instrumentation.common.Timestamp;
import com.google.instrumentation.stats.DistributionAggregation;
import com.google.instrumentation.stats.DistributionAggregation.Range;
import com.google.instrumentation.stats.DistributionAggregationDescriptor;
import com.google.instrumentation.stats.IntervalAggregation;
import com.google.instrumentation.stats.IntervalAggregation.Interval;
import com.google.instrumentation.stats.IntervalAggregationDescriptor;
import com.google.instrumentation.stats.MeasurementDescriptor;
import com.google.instrumentation.stats.MeasurementDescriptor.BasicUnit;
import com.google.instrumentation.stats.MeasurementDescriptor.MeasurementUnit;
import com.google.instrumentation.stats.Tag;
import com.google.instrumentation.stats.TagKey;
import com.google.instrumentation.stats.TagValue;
import com.google.instrumentation.stats.View.DistributionView;
import com.google.instrumentation.stats.View.IntervalView;
import com.google.instrumentation.stats.ViewDescriptor.DistributionViewDescriptor;
import com.google.instrumentation.stats.ViewDescriptor.IntervalViewDescriptor;
import com.google.instrumentation.stats.proto.CensusProto;
import io.grpc.instrumentation.v1alpha.CanonicalRpcStats;
import java.util.Arrays;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/** Unit tests for {@link MonitoringUtil}. */
@RunWith(JUnit4.class)
public class MonitoringUtilTest {
@Test
public void buildCanonicalRpcStatsViewForDistributionView() throws Exception {
assertEquals(
DISTRIBUTION_CANONICAL_STATS_PROTO,
MonitoringUtil.buildCanonicalRpcStatsView(DISTRIBUTION_VIEW));
}
@Test
public void buildCanonicalRpcStatsViewForIntervalView() throws Exception {
assertEquals(
INTERVAL_CANONICAL_STATS_PROTO, MonitoringUtil.buildCanonicalRpcStatsView(INTERVAL_VIEW));
}
@Test
public void serializeMeasurementDescriptor() throws Exception {
assertEquals(
MEASUREMENT_DESC_PROTO,
MonitoringUtil.serializeMeasurementDescriptor(measurementDescriptor));
}
@Test
public void serializeMeasurementUnit() throws Exception {
assertEquals(MEASUREMENT_UNIT_PROTO, MonitoringUtil.serializeMeasurementUnit(MEASUREMENT_UNIT));
}
@Test
public void serializeViewDescriptorForDistributionView() throws Exception {
assertEquals(
DISTRIBUTION_VIEW_DESC_PROTO,
MonitoringUtil.serializeViewDescriptor(DISTRIBUTION_VIEW_DESC));
}
@Test
public void serializeViewDescriptorForIntervalView() throws Exception {
assertEquals(
INTERVAL_VIEW_DESC_PROTO, MonitoringUtil.serializeViewDescriptor(INTERVAL_VIEW_DESC));
}
@Test
public void serializeDistributionAggregationDescriptor() throws Exception {
assertEquals(
DISTRIBUTION_AGG_DESC_PROTO,
MonitoringUtil.serializeDistributionAggregationDescriptor(DISTRIBUTION_AGG_DESC));
}
@Test
public void serializeIntervalAggregationDescriptor() throws Exception {
assertEquals(
INTERVAL_AGG_DESC_PROTO,
MonitoringUtil.serializeIntervalAggregationDescriptor(INTERVAL_AGG_DESC));
}
@Test
public void serializeDuration() throws Exception {
assertEquals(DURATION_PROTO, MonitoringUtil.serializeDuration(DURATION));
}
@Test
public void serializeViewWithDistributionView() throws Exception {
assertEquals(
VIEW_WITH_DISTRIBUTION_VIEW_PROTO, MonitoringUtil.serializeView(DISTRIBUTION_VIEW));
}
@Test
public void serializeViewWithIntervalView() throws Exception {
assertEquals(VIEW_WITH_INTERVAL_VIEW_PROTO, MonitoringUtil.serializeView(INTERVAL_VIEW));
}
@Test
public void serializeDistributionView() throws Exception {
assertEquals(
DISTRIBUTION_VIEW_PROTO, MonitoringUtil.serializeDistributionView(DISTRIBUTION_VIEW));
}
@Test
public void serializeTimestamp() throws Exception {
assertEquals(START_TIMESTAMP_PROTO, MonitoringUtil.serializeTimestamp(START_TIMESTAMP));
}
@Test
public void serializeDistributionAggregation() throws Exception {
assertEquals(
DISTRIBUTION_AGG_PROTO, MonitoringUtil.serializeDistributionAggregation(DISTRIBUTION_AGG));
}
@Test
public void serializeRange() throws Exception {
assertEquals(RANGE_PROTO, MonitoringUtil.serializeRange(RANGE));
}
@Test
public void serializeTag() throws Exception {
assertEquals(TAG_PROTO, MonitoringUtil.serializeTag(TAG));
}
@Test
public void serializeIntervalView() throws Exception {
assertEquals(INTERVAL_VIEW_PROTO, MonitoringUtil.serializeIntervalView(INTERVAL_VIEW));
}
@Test
public void serializeIntervalAggregation() throws Exception {
assertEquals(INTERVAL_AGG_PROTO, MonitoringUtil.serializeIntervalAggregation(INTERVAL_AGG));
}
@Test
public void serializeInterval() throws Exception {
assertEquals(INTERVAL_PROTO, MonitoringUtil.serializeInterval(INTERVAL));
}
private static final int UNIT_POWER = -3;
private static final MeasurementUnit MEASUREMENT_UNIT =
MeasurementUnit.create(
UNIT_POWER,
Arrays.asList(BasicUnit.SCALAR),
Arrays.asList(BasicUnit.SECONDS, BasicUnit.SECONDS));
private static final CensusProto.MeasurementDescriptor.MeasurementUnit MEASUREMENT_UNIT_PROTO =
CensusProto.MeasurementDescriptor.MeasurementUnit.newBuilder()
.setPower10(UNIT_POWER)
.addNumerators(MonitoringUtil.serializeBasicUnit(BasicUnit.SCALAR))
.addDenominators(MonitoringUtil.serializeBasicUnit(BasicUnit.SECONDS))
.addDenominators(MonitoringUtil.serializeBasicUnit(BasicUnit.SECONDS))
.build();
private static final String MEASUREMENT_DESC_NAME = "measurement descriptor name";
private static final String MEASUREMENT_DESC_DESCRIPTION = "measurement descriptor description";
private static final MeasurementDescriptor measurementDescriptor =
MeasurementDescriptor.create(
MEASUREMENT_DESC_NAME, MEASUREMENT_DESC_DESCRIPTION, MEASUREMENT_UNIT);
private static final CensusProto.MeasurementDescriptor MEASUREMENT_DESC_PROTO =
CensusProto.MeasurementDescriptor.newBuilder()
.setName(MEASUREMENT_DESC_NAME)
.setDescription(MEASUREMENT_DESC_DESCRIPTION)
.setUnit(MEASUREMENT_UNIT_PROTO)
.build();
private static final long START_SECONDS = 1L;
private static final int START_NANOS = 1;
private static final long END_SECONDS = 100000L;
private static final int END_NANOS = 9999;
private static final Timestamp START_TIMESTAMP = Timestamp.create(START_SECONDS, START_NANOS);
private static final Timestamp END_TIMESTAMP = Timestamp.create(END_SECONDS, END_NANOS);
private static final CensusProto.Timestamp START_TIMESTAMP_PROTO =
CensusProto.Timestamp.newBuilder().setSeconds(START_SECONDS).setNanos(START_NANOS).build();
private static final CensusProto.Timestamp END_TIMESTAMP_PROTO =
CensusProto.Timestamp.newBuilder().setSeconds(END_SECONDS).setNanos(END_NANOS).build();
private static final String TAG_KEY = "tag key";
private static final String TAG_VALUE = "tag value";
private static final Tag TAG = Tag.create(TagKey.create(TAG_KEY), TagValue.create(TAG_VALUE));
private static final CensusProto.Tag TAG_PROTO =
CensusProto.Tag.newBuilder().setKey(TAG_KEY).setValue(TAG_VALUE).build();
private static final double RANGE_MIN = 0.1;
private static final double RANGE_MAX = 999.9;
private static final Range RANGE = Range.create(RANGE_MIN, RANGE_MAX);
private static final CensusProto.DistributionAggregation.Range RANGE_PROTO =
CensusProto.DistributionAggregation.Range.newBuilder()
.setMin(RANGE_MIN)
.setMax(RANGE_MAX)
.build();
private static final long DISTRIBUTION_AGG_COUNT = 100L;
private static final double DISTRIBUTION_AGG_MEAN = 55.1;
private static final double DISTRIBUTION_AGG_SUM = 4098.5;
private static final long BUCKET_COUNT = 11L;
private static final DistributionAggregation DISTRIBUTION_AGG =
DistributionAggregation.create(
DISTRIBUTION_AGG_COUNT,
DISTRIBUTION_AGG_MEAN,
DISTRIBUTION_AGG_SUM,
RANGE,
Arrays.asList(TAG),
Arrays.asList(BUCKET_COUNT));
private static final CensusProto.DistributionAggregation DISTRIBUTION_AGG_PROTO =
CensusProto.DistributionAggregation.newBuilder()
.setCount(DISTRIBUTION_AGG_COUNT)
.setMean(DISTRIBUTION_AGG_MEAN)
.setSum(DISTRIBUTION_AGG_SUM)
.setRange(RANGE_PROTO)
.addAllBucketCounts(Arrays.asList(BUCKET_COUNT))
.addTags(TAG_PROTO)
.build();
private static final double BUCKET_BOUNDARY = 14.0;
private static final DistributionAggregationDescriptor DISTRIBUTION_AGG_DESC =
DistributionAggregationDescriptor.create(Arrays.asList(BUCKET_BOUNDARY));
private static final CensusProto.DistributionAggregationDescriptor DISTRIBUTION_AGG_DESC_PROTO =
CensusProto.DistributionAggregationDescriptor.newBuilder()
.addBucketBounds(BUCKET_BOUNDARY)
.build();
private static final String DISTRIBUTION_VIEW_NAME = "distribution view name";
private static final String DISTRIBUTION_VIEW_DESCRIPTION = "distribution view description";
private static final DistributionViewDescriptor DISTRIBUTION_VIEW_DESC =
DistributionViewDescriptor.create(
DISTRIBUTION_VIEW_NAME,
DISTRIBUTION_VIEW_DESCRIPTION,
measurementDescriptor,
DISTRIBUTION_AGG_DESC,
Arrays.asList(TagKey.create(TAG_KEY)));
private static final CensusProto.ViewDescriptor DISTRIBUTION_VIEW_DESC_PROTO =
CensusProto.ViewDescriptor.newBuilder()
.setName(DISTRIBUTION_VIEW_NAME)
.setDescription(DISTRIBUTION_VIEW_DESCRIPTION)
.setMeasurementDescriptorName(MEASUREMENT_DESC_NAME)
.setDistributionAggregation(DISTRIBUTION_AGG_DESC_PROTO)
.addTagKeys(TAG_KEY)
.build();
static final DistributionView DISTRIBUTION_VIEW =
DistributionView.create(
DISTRIBUTION_VIEW_DESC, Arrays.asList(DISTRIBUTION_AGG), START_TIMESTAMP, END_TIMESTAMP);
private static final CensusProto.DistributionView DISTRIBUTION_VIEW_PROTO =
CensusProto.DistributionView.newBuilder()
.addAggregations(DISTRIBUTION_AGG_PROTO)
// TODO(ericgribkoff) Re-enable once getter methods are public in instrumentation.
//.setStart(START_TIMESTAMP_PROTO)
//.setEnd(END_TIMESTAMP_PROTO)
.build();
private static final CensusProto.View VIEW_WITH_DISTRIBUTION_VIEW_PROTO =
CensusProto.View.newBuilder()
.setViewName(DISTRIBUTION_VIEW_NAME)
.setDistributionView(DISTRIBUTION_VIEW_PROTO)
.build();
private static final CanonicalRpcStats.View DISTRIBUTION_CANONICAL_STATS_PROTO =
CanonicalRpcStats.View.newBuilder()
.setMeasurementDescriptor(MEASUREMENT_DESC_PROTO)
.setViewDescriptor(DISTRIBUTION_VIEW_DESC_PROTO)
.setView(VIEW_WITH_DISTRIBUTION_VIEW_PROTO)
.build();
private static final long DURATION_SECONDS = 100L;
private static final int DURATION_NANOS = 9999;
private static final Duration DURATION = Duration.create(DURATION_SECONDS, DURATION_NANOS);
private static final CensusProto.Duration DURATION_PROTO =
CensusProto.Duration.newBuilder()
.setSeconds(DURATION_SECONDS)
.setNanos(DURATION_NANOS)
.build();
private static final int NUM_SUB_INTERVALS = 2;
private static final IntervalAggregationDescriptor INTERVAL_AGG_DESC =
IntervalAggregationDescriptor.create(NUM_SUB_INTERVALS, Arrays.asList(DURATION));
private static final CensusProto.IntervalAggregationDescriptor INTERVAL_AGG_DESC_PROTO =
CensusProto.IntervalAggregationDescriptor.newBuilder()
.setNSubIntervals(NUM_SUB_INTERVALS)
.addIntervalSizes(DURATION_PROTO)
.build();
private static final String INTERVAL_VIEW_NAME = "interval view name";
private static final String INTERVAL_VIEW_DESCRIPTION = "interval view description";
private static final IntervalViewDescriptor INTERVAL_VIEW_DESC =
IntervalViewDescriptor.create(
INTERVAL_VIEW_NAME,
INTERVAL_VIEW_DESCRIPTION,
measurementDescriptor,
INTERVAL_AGG_DESC,
Arrays.asList(TagKey.create(TAG_KEY)));
private static final CensusProto.ViewDescriptor INTERVAL_VIEW_DESC_PROTO =
CensusProto.ViewDescriptor.newBuilder()
.setName(INTERVAL_VIEW_NAME)
.setDescription(INTERVAL_VIEW_DESCRIPTION)
.setMeasurementDescriptorName(MEASUREMENT_DESC_NAME)
.setIntervalAggregation(INTERVAL_AGG_DESC_PROTO)
.addTagKeys(TAG_KEY)
.build();
private static final double INTERVAL_COUNT = 6.0;
private static final double INTERVAL_SUM = 98.5;
private static final Interval INTERVAL = Interval.create(DURATION, INTERVAL_COUNT, INTERVAL_SUM);
private static final CensusProto.IntervalAggregation.Interval INTERVAL_PROTO =
CensusProto.IntervalAggregation.Interval.newBuilder()
.setIntervalSize(DURATION_PROTO)
.setCount(INTERVAL_COUNT)
.setSum(INTERVAL_SUM)
.build();
private static final IntervalAggregation INTERVAL_AGG =
IntervalAggregation.create(Arrays.asList(TAG), Arrays.asList(INTERVAL));
private static final CensusProto.IntervalAggregation INTERVAL_AGG_PROTO =
CensusProto.IntervalAggregation.newBuilder()
.addIntervals(INTERVAL_PROTO)
.addTags(TAG_PROTO)
.build();
static final IntervalView INTERVAL_VIEW =
IntervalView.create(INTERVAL_VIEW_DESC, Arrays.asList(INTERVAL_AGG));
private static final CensusProto.IntervalView INTERVAL_VIEW_PROTO =
CensusProto.IntervalView.newBuilder().addAggregations(INTERVAL_AGG_PROTO).build();
private static final CensusProto.View VIEW_WITH_INTERVAL_VIEW_PROTO =
CensusProto.View.newBuilder()
.setViewName(INTERVAL_VIEW_NAME)
.setIntervalView(INTERVAL_VIEW_PROTO)
.build();
private static final CanonicalRpcStats.View INTERVAL_CANONICAL_STATS_PROTO =
CanonicalRpcStats.View.newBuilder()
.setMeasurementDescriptor(MEASUREMENT_DESC_PROTO)
.setViewDescriptor(INTERVAL_VIEW_DESC_PROTO)
.setView(VIEW_WITH_INTERVAL_VIEW_PROTO)
.build();
}