control.proto 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. // Copyright 2016 gRPC authors.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. import "payloads.proto";
  16. import "stats.proto";
  17. package grpc.testing;
  18. enum ClientType {
  19. SYNC_CLIENT = 0;
  20. ASYNC_CLIENT = 1;
  21. }
  22. enum ServerType {
  23. SYNC_SERVER = 0;
  24. ASYNC_SERVER = 1;
  25. ASYNC_GENERIC_SERVER = 2;
  26. }
  27. enum RpcType {
  28. UNARY = 0;
  29. STREAMING = 1;
  30. }
  31. // Parameters of poisson process distribution, which is a good representation
  32. // of activity coming in from independent identical stationary sources.
  33. message PoissonParams {
  34. // The rate of arrivals (a.k.a. lambda parameter of the exp distribution).
  35. double offered_load = 1;
  36. }
  37. message UniformParams {
  38. double interarrival_lo = 1;
  39. double interarrival_hi = 2;
  40. }
  41. message DeterministicParams {
  42. double offered_load = 1;
  43. }
  44. message ParetoParams {
  45. double interarrival_base = 1;
  46. double alpha = 2;
  47. }
  48. // Once an RPC finishes, immediately start a new one.
  49. // No configuration parameters needed.
  50. message ClosedLoopParams {
  51. }
  52. message LoadParams {
  53. oneof load {
  54. ClosedLoopParams closed_loop = 1;
  55. PoissonParams poisson = 2;
  56. UniformParams uniform = 3;
  57. DeterministicParams determ = 4;
  58. ParetoParams pareto = 5;
  59. };
  60. }
  61. // presence of SecurityParams implies use of TLS
  62. message SecurityParams {
  63. bool use_test_ca = 1;
  64. string server_host_override = 2;
  65. }
  66. message ClientConfig {
  67. // List of targets to connect to. At least one target needs to be specified.
  68. repeated string server_targets = 1;
  69. ClientType client_type = 2;
  70. SecurityParams security_params = 3;
  71. // How many concurrent RPCs to start for each channel.
  72. // For synchronous client, use a separate thread for each outstanding RPC.
  73. int32 outstanding_rpcs_per_channel = 4;
  74. // Number of independent client channels to create.
  75. // i-th channel will connect to server_target[i % server_targets.size()]
  76. int32 client_channels = 5;
  77. // Only for async client. Number of threads to use to start/manage RPCs.
  78. int32 async_client_threads = 7;
  79. RpcType rpc_type = 8;
  80. // The requested load for the entire client (aggregated over all the threads).
  81. LoadParams load_params = 10;
  82. PayloadConfig payload_config = 11;
  83. HistogramParams histogram_params = 12;
  84. // Specify the cores we should run the client on, if desired
  85. repeated int32 core_list = 13;
  86. int32 core_limit = 14;
  87. }
  88. message ClientStatus {
  89. ClientStats stats = 1;
  90. }
  91. // Request current stats
  92. message Mark {
  93. // if true, the stats will be reset after taking their snapshot.
  94. bool reset = 1;
  95. }
  96. message ClientArgs {
  97. oneof argtype {
  98. ClientConfig setup = 1;
  99. Mark mark = 2;
  100. }
  101. }
  102. message ServerConfig {
  103. ServerType server_type = 1;
  104. SecurityParams security_params = 2;
  105. // Port on which to listen. Zero means pick unused port.
  106. int32 port = 4;
  107. // Only for async server. Number of threads used to serve the requests.
  108. int32 async_server_threads = 7;
  109. // Specify the number of cores to limit server to, if desired
  110. int32 core_limit = 8;
  111. // payload config, used in generic server
  112. PayloadConfig payload_config = 9;
  113. // Specify the cores we should run the server on, if desired
  114. repeated int32 core_list = 10;
  115. }
  116. message ServerArgs {
  117. oneof argtype {
  118. ServerConfig setup = 1;
  119. Mark mark = 2;
  120. }
  121. }
  122. message ServerStatus {
  123. ServerStats stats = 1;
  124. // the port bound by the server
  125. int32 port = 2;
  126. // Number of cores available to the server
  127. int32 cores = 3;
  128. }
  129. message CoreRequest {
  130. }
  131. message CoreResponse {
  132. // Number of cores available on the server
  133. int32 cores = 1;
  134. }
  135. message Void {
  136. }
  137. // A single performance scenario: input to qps_json_driver
  138. message Scenario {
  139. // Human readable name for this scenario
  140. string name = 1;
  141. // Client configuration
  142. ClientConfig client_config = 2;
  143. // Number of clients to start for the test
  144. int32 num_clients = 3;
  145. // Server configuration
  146. ServerConfig server_config = 4;
  147. // Number of servers to start for the test
  148. int32 num_servers = 5;
  149. // Warmup period, in seconds
  150. int32 warmup_seconds = 6;
  151. // Benchmark time, in seconds
  152. int32 benchmark_seconds = 7;
  153. // Number of workers to spawn locally (usually zero)
  154. int32 spawn_local_worker_count = 8;
  155. }
  156. // A set of scenarios to be run with qps_json_driver
  157. message Scenarios {
  158. repeated Scenario scenarios = 1;
  159. }