perf_control.proto 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. // Copyright 2015, Google Inc.
  2. // All rights reserved.
  3. //
  4. // Redistribution and use in source and binary forms, with or without
  5. // modification, are permitted provided that the following conditions are
  6. // met:
  7. //
  8. // * Redistributions of source code must retain the above copyright
  9. // notice, this list of conditions and the following disclaimer.
  10. // * Redistributions in binary form must reproduce the above
  11. // copyright notice, this list of conditions and the following disclaimer
  12. // in the documentation and/or other materials provided with the
  13. // distribution.
  14. // * Neither the name of Google Inc. nor the names of its
  15. // contributors may be used to endorse or promote products derived from
  16. // this software without specific prior written permission.
  17. //
  18. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. // An integration test service that covers all the method signature permutations
  30. // of unary/streaming requests/responses.
  31. syntax = "proto3";
  32. import "test/proto/messages.proto";
  33. import "test/proto/perf_stats.proto";
  34. package grpc.testing;
  35. enum ClientType {
  36. SYNCHRONOUS_CLIENT = 0;
  37. ASYNC_CLIENT = 1;
  38. }
  39. enum ServerType {
  40. SYNCHRONOUS_SERVER = 0;
  41. ASYNC_SERVER = 1;
  42. }
  43. enum RpcType {
  44. UNARY = 0;
  45. STREAMING = 1;
  46. }
  47. enum LoadType {
  48. CLOSED_LOOP = 0;
  49. POISSON = 1;
  50. UNIFORM = 2;
  51. DETERMINISTIC = 3;
  52. PARETO = 4;
  53. }
  54. message PoissonParams {
  55. double offered_load = 1;
  56. }
  57. message UniformParams {
  58. double interarrival_lo = 1;
  59. double interarrival_hi = 2;
  60. }
  61. message DeterministicParams {
  62. double offered_load = 1;
  63. }
  64. message ParetoParams {
  65. double interarrival_base = 1;
  66. double alpha = 2;
  67. }
  68. message LoadParams {
  69. oneof load {
  70. PoissonParams poisson = 1;
  71. UniformParams uniform = 2;
  72. DeterministicParams determ = 3;
  73. ParetoParams pareto = 4;
  74. };
  75. }
  76. message ClientConfig {
  77. repeated string server_targets = 1;
  78. ClientType client_type = 2;
  79. bool enable_ssl = 3;
  80. int32 outstanding_rpcs_per_channel = 4;
  81. int32 client_channels = 5;
  82. int32 payload_size = 6;
  83. // only for async client:
  84. int32 async_client_threads = 7;
  85. RpcType rpc_type = 8;
  86. string host = 9;
  87. LoadType load_type = 10;
  88. LoadParams load_params = 11;
  89. }
  90. message ClientStatus {
  91. ClientStats stats = 1;
  92. }
  93. // Request current stats
  94. message Mark {
  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. int32 threads = 2;
  105. bool enable_ssl = 3;
  106. string host = 4;
  107. }
  108. message ServerArgs {
  109. oneof argtype {
  110. ServerConfig setup = 1;
  111. Mark mark = 2;
  112. }
  113. }
  114. message ServerStatus {
  115. ServerStats stats = 1;
  116. int32 port = 2;
  117. }
  118. service TestService {
  119. // One request followed by one response.
  120. // The server returns the client payload as-is.
  121. rpc UnaryCall(SimpleRequest) returns (SimpleResponse);
  122. // One request followed by one response.
  123. // The server returns the client payload as-is.
  124. rpc StreamingCall(stream SimpleRequest) returns (stream SimpleResponse);
  125. }
  126. service Worker {
  127. // Start server with specified workload
  128. rpc RunServer(stream ServerArgs) returns (stream ServerStatus);
  129. // Start client with specified workload
  130. rpc RunClient(stream ClientArgs) returns (stream ClientStatus);
  131. }