MCPcopy Create free account
hub / github.com/grpc/grpc-java / makeRequest

Method makeRequest

benchmarks/src/main/java/io/grpc/benchmarks/Utils.java:271–284  ·  view source on GitHub ↗

Construct a SimpleRequest with the specified dimensions.

(Messages.PayloadType payloadType, int reqLength,
                                          int respLength)

Source from the content-addressed store, hash-verified

269 * Construct a {@link SimpleRequest} with the specified dimensions.
270 */
271 public static SimpleRequest makeRequest(Messages.PayloadType payloadType, int reqLength,
272 int respLength) {
273 ByteString body = ByteString.copyFrom(new byte[reqLength]);
274 Payload payload = Payload.newBuilder()
275 .setType(payloadType)
276 .setBody(body)
277 .build();
278
279 return SimpleRequest.newBuilder()
280 .setResponseType(payloadType)
281 .setResponseSize(respLength)
282 .setPayload(payload)
283 .build();
284 }
285
286 /**
287 * Picks a port that is not used right at this moment.

Callers 2

newRequestMethod · 0.95
LoadClientMethod · 0.95

Calls 3

setTypeMethod · 0.80
buildMethod · 0.65
newBuilderMethod · 0.45

Tested by

no test coverage detected