| 311 | } |
| 312 | |
| 313 | func configuredPrefixes(cfg benchmarkConfig) []string { |
| 314 | prefixSet := make(map[string]struct{}) |
| 315 | |
| 316 | if prefix := strings.TrimSpace(cfg.queuePrefix); prefix != "" { |
| 317 | prefixSet[prefix] = struct{}{} |
| 318 | } |
| 319 | |
| 320 | for _, raw := range strings.Split(cfg.queuePrefixes, ",") { |
| 321 | prefix := strings.TrimSpace(raw) |
| 322 | if prefix != "" { |
| 323 | prefixSet[prefix] = struct{}{} |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | prefixes := make([]string, 0, len(prefixSet)) |
| 328 | for prefix := range prefixSet { |
| 329 | prefixes = append(prefixes, prefix) |
| 330 | } |
| 331 | sort.Strings(prefixes) |
| 332 | return prefixes |
| 333 | } |
| 334 | |
| 335 | func hasWork(s snapshot) bool { |
| 336 | return s.pending+s.active+s.scheduled+s.retry+s.aggregating > 0 |