Check whether the given argument has valid goodput configuration or not
(args)
| 599 | |
| 600 | |
| 601 | def check_goodput_args(args): |
| 602 | """Check whether the given argument has valid goodput configuration or not""" |
| 603 | # Check and parse goodput arguments |
| 604 | goodput_config_dict = {} |
| 605 | VALID_NAMES = ["ttft", "tpot", "e2el"] |
| 606 | if args.goodput: |
| 607 | goodput_config_dict = parse_goodput(args.goodput) |
| 608 | for slo_name, slo_val in goodput_config_dict.items(): |
| 609 | if slo_name not in VALID_NAMES: |
| 610 | raise ValueError( |
| 611 | f"Invalid metric name found, {slo_name}: {slo_val}. " |
| 612 | "The service level objective name should be one of " |
| 613 | f"{VALID_NAMES!s}. " |
| 614 | ) |
| 615 | if slo_val < 0: |
| 616 | raise ValueError( |
| 617 | f"Invalid value found, {slo_name}: {slo_val}. " |
| 618 | "The service level objective value should be " |
| 619 | "non-negative." |
| 620 | ) |
| 621 | return goodput_config_dict |
| 622 | |
| 623 | |
| 624 | def parse_goodput(slo_pairs): |
no test coverage detected