DoUnaryCall performs a unary RPC with given stub and request and response sizes.
(tc testgrpc.BenchmarkServiceClient, reqSize, respSize int)
| 278 | |
| 279 | // DoUnaryCall performs a unary RPC with given stub and request and response sizes. |
| 280 | func DoUnaryCall(tc testgrpc.BenchmarkServiceClient, reqSize, respSize int) error { |
| 281 | pl := NewPayload(testpb.PayloadType_COMPRESSABLE, reqSize) |
| 282 | req := &testpb.SimpleRequest{ |
| 283 | ResponseType: pl.Type, |
| 284 | ResponseSize: int32(respSize), |
| 285 | Payload: pl, |
| 286 | } |
| 287 | if _, err := tc.UnaryCall(context.Background(), req); err != nil { |
| 288 | return fmt.Errorf("/BenchmarkService/UnaryCall(_, _) = _, %v, want _, <nil>", err) |
| 289 | } |
| 290 | return nil |
| 291 | } |
| 292 | |
| 293 | // DoStreamingRoundTrip performs a round trip for a single streaming rpc. |
| 294 | func DoStreamingRoundTrip(stream testgrpc.BenchmarkService_StreamingCallClient, reqSize, respSize int) error { |
no test coverage detected