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

Function runModesFromWorkloads

benchmark/benchmain/main.go:216–234  ·  view source on GitHub ↗

runModesFromWorkloads determines the runModes based on the value of workloads flag set by the user.

(workload string)

Source from the content-addressed store, hash-verified

214// runModesFromWorkloads determines the runModes based on the value of
215// workloads flag set by the user.
216func runModesFromWorkloads(workload string) runModes {
217 r := runModes{}
218 switch workload {
219 case workloadsUnary:
220 r.unary = true
221 case workloadsStreaming:
222 r.streaming = true
223 case workloadsUnconstrained:
224 r.unconstrained = true
225 case workloadsAll:
226 r.unary = true
227 r.streaming = true
228 r.unconstrained = true
229 default:
230 log.Fatalf("Unknown workloads setting: %v (want one of: %v)",
231 workloads, strings.Join(allWorkloads, ", "))
232 }
233 return r
234}
235
236type startFunc func(mode string, bf stats.Features)
237type stopFunc func(count uint64)

Callers 1

processFlagsFunction · 0.85

Calls 2

JoinMethod · 0.80
FatalfMethod · 0.65

Tested by

no test coverage detected