[PSM Interop] Synchronize messages.proto (#34182)

pull/34187/head
Eugene Ostroukhov 1 year ago committed by GitHub
parent ac3b9ba80b
commit 73c5da6f02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      src/proto/grpc/testing/messages.proto
  2. 6
      test/cpp/interop/xds_interop_server_lib.cc
  3. 4
      test/cpp/interop/xds_stats_watcher.cc
  4. 4
      test/cpp/interop/xds_stats_watcher_test.cc

@ -214,8 +214,9 @@ message LoadBalancerStatsRequest {
message LoadBalancerStatsResponse {
enum MetadataType {
Initial = 0;
Trailing = 1;
UNKNOWN = 0;
INITIAL = 1;
TRAILING = 2;
}
message MetadataEntry {
// Key, exactly as received from the server. Case may be different from what
@ -223,7 +224,7 @@ message LoadBalancerStatsResponse {
string key = 1;
// Value, exactly as received from the server.
string value = 2;
// Metadata type is either Initial or Trailing
// Metadata type
MetadataType type = 3;
}
message RpcMetadata {
@ -318,16 +319,17 @@ message TestOrcaReport {
map<string, double> utilization = 4;
}
enum HookRequestCommand {
// Start the HTTP endpoint
START = 0;
// Stop
STOP = 1;
// Return from HTTP GET/POST
RETURN = 2;
}
message HookRequest {
enum HookRequestCommand {
// Default value
UNSPECIFIED = 0;
// Start the HTTP endpoint
START = 1;
// Stop
STOP = 2;
// Return from HTTP GET/POST
RETURN = 3;
}
HookRequestCommand command = 1;
int32 grpc_code_to_return = 2;
string grpc_status_description = 3;

@ -137,11 +137,11 @@ class XdsUpdateHealthServiceImpl : public XdsUpdateHealthService::Service {
const HookRequest* request,
HookResponse* /* response */) override {
switch (request->command()) {
case HookRequestCommand::START:
case HookRequest::START:
return pre_stop_hook_server_->Start(request->server_port(), 30 /* s */);
case HookRequestCommand::STOP:
case HookRequest::STOP:
return pre_stop_hook_server_->Stop();
case HookRequestCommand::RETURN:
case HookRequest::RETURN:
pre_stop_hook_server_->Return(
static_cast<StatusCode>(request->grpc_code_to_return()),
request->grpc_status_description());

@ -84,9 +84,9 @@ void XdsStatsWatcher::RpcCompleted(
rpcs_by_type_[call.rpc_type][peer]++;
auto* rpc_metadata = metadata_by_peer_[peer].add_rpc_metadata();
AddRpcMetadata(rpc_metadata, metadata_keys_, include_all_metadata_,
initial_metadata, LoadBalancerStatsResponse::Initial);
initial_metadata, LoadBalancerStatsResponse::INITIAL);
AddRpcMetadata(rpc_metadata, metadata_keys_, include_all_metadata_,
trailing_metadata, LoadBalancerStatsResponse::Trailing);
trailing_metadata, LoadBalancerStatsResponse::TRAILING);
}
rpcs_needed_--;
// Report accumulated stats.

@ -54,8 +54,8 @@ LoadBalancerStatsResponse::MetadataByPeer BuildMetadatas(
entry->set_key(key_value.key);
entry->set_value(key_value.value);
entry->set_type(key_value.is_trailing
? LoadBalancerStatsResponse::Trailing
: LoadBalancerStatsResponse::Initial);
? LoadBalancerStatsResponse::TRAILING
: LoadBalancerStatsResponse::INITIAL);
}
}
return metadata_by_peer;

Loading…
Cancel
Save