runModesFromWorkloads determines the runModes based on the value of workloads flag set by the user.
(workload string)
| 214 | // runModesFromWorkloads determines the runModes based on the value of |
| 215 | // workloads flag set by the user. |
| 216 | func 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 | |
| 236 | type startFunc func(mode string, bf stats.Features) |
| 237 | type stopFunc func(count uint64) |
no test coverage detected