OSDN Git Service

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