MCPcopy
hub / github.com/grpc/grpc-go / makeFuncUnary

Function makeFuncUnary

benchmark/benchmain/main.go:419–432  ·  view source on GitHub ↗
(bf stats.Features)

Source from the content-addressed store, hash-verified

417}
418
419func makeFuncUnary(bf stats.Features) (rpcCallFunc, rpcCleanupFunc) {
420 clients, cleanup := makeClients(bf)
421 return func(cn, _ int) {
422 reqSizeBytes := bf.ReqSizeBytes
423 respSizeBytes := bf.RespSizeBytes
424 if bf.ReqPayloadCurve != nil {
425 reqSizeBytes = bf.ReqPayloadCurve.ChooseRandom()
426 }
427 if bf.RespPayloadCurve != nil {
428 respSizeBytes = bf.RespPayloadCurve.ChooseRandom()
429 }
430 unaryCaller(clients[cn], reqSizeBytes, respSizeBytes)
431 }, cleanup
432}
433
434func makeFuncStream(bf stats.Features) (rpcCallFunc, rpcCleanupFunc) {
435 streams, req, cleanup := setupStream(bf, false)

Callers 1

unaryBenchmarkFunction · 0.85

Calls 3

makeClientsFunction · 0.85
unaryCallerFunction · 0.85
ChooseRandomMethod · 0.80

Tested by

no test coverage detected