~ubuntu-branches/ubuntu/wily/grpc/wily

« back to all changes in this revision

Viewing changes to test/cpp/qps/qpstest.proto

  • Committer: Package Import Robot
  • Author(s): Andrew Pollock
  • Date: 2015-05-07 13:28:11 UTC
  • Revision ID: package-import@ubuntu.com-20150507132811-ybm4hfq73tnvvd2e
Tags: upstream-0.10.0
ImportĀ upstreamĀ versionĀ 0.10.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// Copyright 2015, Google Inc.
 
3
// All rights reserved.
 
4
//
 
5
// Redistribution and use in source and binary forms, with or without
 
6
// modification, are permitted provided that the following conditions are
 
7
// met:
 
8
//
 
9
//     * Redistributions of source code must retain the above copyright
 
10
// notice, this list of conditions and the following disclaimer.
 
11
//     * Redistributions in binary form must reproduce the above
 
12
// copyright notice, this list of conditions and the following disclaimer
 
13
// in the documentation and/or other materials provided with the
 
14
// distribution.
 
15
//     * Neither the name of Google Inc. nor the names of its
 
16
// contributors may be used to endorse or promote products derived from
 
17
// this software without specific prior written permission.
 
18
//
 
19
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
20
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
21
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
22
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
23
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
24
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
25
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
26
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
27
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
28
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
29
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
30
 
 
31
// An integration test service that covers all the method signature permutations
 
32
// of unary/streaming requests/responses.
 
33
syntax = "proto3";
 
34
 
 
35
package grpc.testing;
 
36
 
 
37
enum PayloadType {
 
38
  // Compressable text format.
 
39
  COMPRESSABLE = 0;
 
40
 
 
41
  // Uncompressable binary format.
 
42
  UNCOMPRESSABLE = 1;
 
43
 
 
44
  // Randomly chosen from all other formats defined in this enum.
 
45
  RANDOM = 2;
 
46
}
 
47
 
 
48
message StatsRequest {
 
49
  // run number
 
50
  int32 test_num = 1;
 
51
}
 
52
 
 
53
message ServerStats {
 
54
  // wall clock time
 
55
  double time_elapsed = 1;
 
56
 
 
57
  // user time used by the server process and threads
 
58
  double time_user = 2;
 
59
 
 
60
  // server time used by the server process and all threads
 
61
  double time_system = 3;
 
62
}
 
63
 
 
64
message Payload {
 
65
  // The type of data in body.
 
66
  PayloadType type = 1;
 
67
  // Primary contents of payload.
 
68
  bytes body = 2;
 
69
}
 
70
 
 
71
message HistogramData {
 
72
  repeated uint32 bucket = 1;
 
73
  double min_seen = 2;
 
74
  double max_seen = 3;
 
75
  double sum = 4;
 
76
  double sum_of_squares = 5;
 
77
  double count = 6;
 
78
}
 
79
 
 
80
enum ClientType {
 
81
  SYNCHRONOUS_CLIENT = 0;
 
82
  ASYNC_CLIENT = 1;
 
83
}
 
84
 
 
85
enum ServerType {
 
86
  SYNCHRONOUS_SERVER = 0;
 
87
  ASYNC_SERVER = 1;
 
88
}
 
89
 
 
90
enum RpcType {
 
91
  UNARY = 0;
 
92
  STREAMING = 1;
 
93
}
 
94
 
 
95
enum LoadType {
 
96
  CLOSED_LOOP = 0;
 
97
  POISSON = 1;
 
98
  UNIFORM = 2;
 
99
  DETERMINISTIC = 3;
 
100
  PARETO = 4;
 
101
}
 
102
 
 
103
message PoissonParams {
 
104
  double offered_load = 1;
 
105
}
 
106
 
 
107
message UniformParams {
 
108
  double interarrival_lo = 1;
 
109
  double interarrival_hi = 2;
 
110
}
 
111
 
 
112
message DeterministicParams {
 
113
  double offered_load = 1;
 
114
}
 
115
 
 
116
message ParetoParams {
 
117
  double interarrival_base = 1;
 
118
  double alpha = 2;
 
119
}
 
120
 
 
121
message LoadParams {
 
122
  oneof load {
 
123
    PoissonParams poisson = 1;
 
124
    UniformParams uniform = 2;
 
125
    DeterministicParams determ = 3;
 
126
    ParetoParams pareto = 4;
 
127
  };
 
128
}
 
129
 
 
130
message ClientConfig {
 
131
  repeated string server_targets = 1;
 
132
  ClientType client_type = 2;
 
133
  bool enable_ssl = 3;
 
134
  int32 outstanding_rpcs_per_channel = 4;
 
135
  int32 client_channels = 5;
 
136
  int32 payload_size = 6;
 
137
  // only for async client:
 
138
  int32 async_client_threads = 7;
 
139
  RpcType rpc_type = 8;
 
140
  string host = 9;
 
141
  LoadType load_type = 10;
 
142
  LoadParams load_params = 11;
 
143
}
 
144
 
 
145
// Request current stats
 
146
message Mark {
 
147
}
 
148
 
 
149
message ClientArgs {
 
150
  oneof argtype {
 
151
    ClientConfig setup = 1;
 
152
    Mark mark = 2;
 
153
  }
 
154
}
 
155
 
 
156
message ClientStats {
 
157
  HistogramData latencies = 1;
 
158
  double time_elapsed = 2;
 
159
  double time_user = 3;
 
160
  double time_system = 4;
 
161
}
 
162
 
 
163
message ClientStatus {
 
164
  ClientStats stats = 1;
 
165
}
 
166
 
 
167
message ServerConfig {
 
168
  ServerType server_type = 1;
 
169
  int32 threads = 2;
 
170
  bool enable_ssl = 3;
 
171
  string host = 4;
 
172
}
 
173
 
 
174
message ServerArgs {
 
175
  oneof argtype {
 
176
    ServerConfig setup = 1;
 
177
    Mark mark = 2;
 
178
  }
 
179
}
 
180
 
 
181
message ServerStatus {
 
182
  ServerStats stats = 1;
 
183
  int32 port = 2;
 
184
}
 
185
 
 
186
message SimpleRequest {
 
187
  // Desired payload type in the response from the server.
 
188
  // If response_type is RANDOM, server randomly chooses one from other formats.
 
189
  PayloadType response_type = 1;
 
190
 
 
191
  // Desired payload size in the response from the server.
 
192
  // If response_type is COMPRESSABLE, this denotes the size before compression.
 
193
  int32 response_size = 2;
 
194
 
 
195
  // Optional input payload sent along with the request.
 
196
  Payload payload = 3;
 
197
}
 
198
 
 
199
message SimpleResponse {
 
200
  Payload payload = 1;
 
201
}
 
202
 
 
203
service TestService {
 
204
  // One request followed by one response.
 
205
  // The server returns the client payload as-is.
 
206
  rpc UnaryCall(SimpleRequest) returns (SimpleResponse);
 
207
 
 
208
  // One request followed by one response.
 
209
  // The server returns the client payload as-is.
 
210
  rpc StreamingCall(stream SimpleRequest) returns (stream SimpleResponse);
 
211
}
 
212
 
 
213
service Worker {
 
214
  // Start test with specified workload
 
215
  rpc RunTest(stream ClientArgs) returns (stream ClientStatus);
 
216
  // Start test with specified workload
 
217
  rpc RunServer(stream ServerArgs) returns (stream ServerStatus);
 
218
}