(bf stats.Features)
| 432 | } |
| 433 | |
| 434 | func makeFuncStream(bf stats.Features) (rpcCallFunc, rpcCleanupFunc) { |
| 435 | streams, req, cleanup := setupStream(bf, false) |
| 436 | |
| 437 | var preparedMsg [][]*grpc.PreparedMsg |
| 438 | if bf.EnablePreloader { |
| 439 | preparedMsg = prepareMessages(streams, req) |
| 440 | } |
| 441 | |
| 442 | return func(cn, pos int) { |
| 443 | reqSizeBytes := bf.ReqSizeBytes |
| 444 | respSizeBytes := bf.RespSizeBytes |
| 445 | if bf.ReqPayloadCurve != nil { |
| 446 | reqSizeBytes = bf.ReqPayloadCurve.ChooseRandom() |
| 447 | } |
| 448 | if bf.RespPayloadCurve != nil { |
| 449 | respSizeBytes = bf.RespPayloadCurve.ChooseRandom() |
| 450 | } |
| 451 | var req any |
| 452 | if bf.EnablePreloader { |
| 453 | req = preparedMsg[cn][pos] |
| 454 | } else { |
| 455 | pl := benchmark.NewPayload(testpb.PayloadType_COMPRESSABLE, reqSizeBytes) |
| 456 | req = &testpb.SimpleRequest{ |
| 457 | ResponseType: pl.Type, |
| 458 | ResponseSize: int32(respSizeBytes), |
| 459 | Payload: pl, |
| 460 | } |
| 461 | } |
| 462 | streamCaller(streams[cn][pos], req) |
| 463 | }, cleanup |
| 464 | } |
| 465 | |
| 466 | func makeFuncUnconstrainedStreamPreloaded(bf stats.Features) (rpcSendFunc, rpcRecvFunc, rpcCleanupFunc) { |
| 467 | streams, req, cleanup := setupStream(bf, true) |
no test coverage detected