diff --git a/src/proto/grpc/testing/messages.proto b/src/proto/grpc/testing/messages.proto index cfb1222ac82..559876ed7c0 100644 --- a/src/proto/grpc/testing/messages.proto +++ b/src/proto/grpc/testing/messages.proto @@ -237,8 +237,8 @@ message LoadBalancerAccumulatedStatsResponse { map result = 2; } - // Per-method RPC statistics. The key is the full method path; i.e. - // "/proto.package.ServiceName/MethodName". + // Per-method RPC statistics. The key is the RpcType in string form; e.g. + // 'EMPTY_CALL' or 'UNARY_CALL' map stats_per_method = 4; } diff --git a/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py b/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py index 0382007f208..7580d7ff70e 100644 --- a/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py +++ b/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py @@ -49,9 +49,9 @@ _METHOD_STR_TO_ENUM = { "EmptyCall": messages_pb2.ClientConfigureRequest.EMPTY_CALL, } -_METHOD_CAMEL_TO_FULL_PATH = { - "UnaryCall": "/grpc.testing.TestService/UnaryCall", - "EmptyCall": "/grpc.testing.TestService/EmptyCall", +_METHOD_CAMEL_TO_CAPS_SNAKE = { + "UnaryCall": "UNARY_CALL", + "EmptyCall": "EMPTY_CALL", } _METHOD_ENUM_TO_STR = {v: k for k, v in _METHOD_STR_TO_ENUM.items()} @@ -161,17 +161,17 @@ class _LoadBalancerStatsServicer(test_pb2_grpc.LoadBalancerStatsServiceServicer response = messages_pb2.LoadBalancerAccumulatedStatsResponse() with _global_lock: for method in _SUPPORTED_METHODS: - method_path = _METHOD_CAMEL_TO_FULL_PATH[method] + caps_method = _METHOD_CAMEL_TO_CAPS_SNAKE[method] response.num_rpcs_started_by_method[ - method_path] = _global_rpcs_started[method] + caps_method] = _global_rpcs_started[method] response.num_rpcs_succeeded_by_method[ - method_path] = _global_rpcs_succeeded[method] + caps_method] = _global_rpcs_succeeded[method] response.num_rpcs_failed_by_method[ - method_path] = _global_rpcs_failed[method] + caps_method] = _global_rpcs_failed[method] response.stats_per_method[ - method_path].rpcs_started = _global_rpcs_started[method] + caps_method].rpcs_started = _global_rpcs_started[method] for code, count in _global_rpc_statuses[method].items(): - response.stats_per_method[method_path].result[code] = count + response.stats_per_method[caps_method].result[code] = count logger.info("Returning cumulative stats response.") return response