Home | History | Annotate | Download | only in testing
      1 // Copyright 2015-2016 The 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 // An integration test service that covers all the method signature permutations
     15 // of unary/streaming requests/responses.
     16 syntax = "proto3";
     17 
     18 import "grpc/testing/messages.proto";
     19 import "grpc/testing/control.proto";
     20 
     21 package grpc.testing;
     22 
     23 option java_package = "io.grpc.benchmarks.proto";
     24 option java_outer_classname = "Services";
     25 
     26 service BenchmarkService {
     27   // One request followed by one response.
     28   // The server returns the client payload as-is.
     29   rpc UnaryCall(SimpleRequest) returns (SimpleResponse);
     30 
     31   // Repeated sequence of one request followed by one response.
     32   // Should be called streaming ping-pong
     33   // The server returns the client payload as-is on each response
     34   rpc StreamingCall(stream SimpleRequest) returns (stream SimpleResponse);
     35 
     36   // Single-sided unbounded streaming from client to server
     37   // The server returns the client payload as-is once the client does WritesDone
     38   rpc StreamingFromClient(stream SimpleRequest) returns (SimpleResponse);
     39 
     40   // Single-sided unbounded streaming from server to client
     41   // The server repeatedly returns the client payload as-is
     42   rpc StreamingFromServer(SimpleRequest) returns (stream SimpleResponse);
     43 
     44   // Two-sided unbounded streaming between server to client
     45   // Both sides send the content of their own choice to the other
     46   rpc StreamingBothWays(stream SimpleRequest) returns (stream SimpleResponse);
     47 }
     48 
     49 service WorkerService {
     50   // Start server with specified workload.
     51   // First request sent specifies the ServerConfig followed by ServerStatus
     52   // response. After that, a "Mark" can be sent anytime to request the latest
     53   // stats. Closing the stream will initiate shutdown of the test server
     54   // and once the shutdown has finished, the OK status is sent to terminate
     55   // this RPC.
     56   rpc RunServer(stream ServerArgs) returns (stream ServerStatus);
     57 
     58   // Start client with specified workload.
     59   // First request sent specifies the ClientConfig followed by ClientStatus
     60   // response. After that, a "Mark" can be sent anytime to request the latest
     61   // stats. Closing the stream will initiate shutdown of the test client
     62   // and once the shutdown has finished, the OK status is sent to terminate
     63   // this RPC.
     64   rpc RunClient(stream ClientArgs) returns (stream ClientStatus);
     65 
     66   // Just return the core count - unary call
     67   rpc CoreCount(CoreRequest) returns (CoreResponse);
     68 
     69   // Quit this worker
     70   rpc QuitWorker(Void) returns (Void);
     71 }
     72 
     73 service ReportQpsScenarioService {
     74   // Report results of a QPS test benchmark scenario.
     75   rpc ReportScenario(ScenarioResult) returns (Void);
     76 }
     77