|
|
|
@ -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 |
|
|
|
|
|
|
|
|
|