| 675 | "|---:|---:|---:|---:|---:|---:|---:|---:|", |
| 676 | ] |
| 677 | def append_resource_rows(resources: dict) -> None: |
| 678 | if not resources: |
| 679 | lines.append("| n/a | 0 | n/a | n/a | n/a | n/a | n/a | n/a |") |
| 680 | return |
| 681 | for gpu, res in resources.items(): |
| 682 | lines.append( |
| 683 | "| {gpu} | {samples} | {mem} | {temp} | {pavg} | {pmax} | {uavg} | {umax} |".format( |
| 684 | gpu=gpu, |
| 685 | samples=res.get("samples", 0), |
| 686 | mem=fmt(res.get("mem_max_mib")), |
| 687 | temp=fmt(res.get("temp_max_c")), |
| 688 | pavg=fmt(res.get("power_avg_w")), |
| 689 | pmax=fmt(res.get("power_max_w")), |
| 690 | uavg=fmt(res.get("util_avg_pct")), |
| 691 | umax=fmt(res.get("util_max_pct")), |
| 692 | ) |
| 693 | ) |
| 694 | |
| 695 | append_resource_rows(summary.get("pflash_resource_summary") or { |
| 696 | str(summary["pflash_gpu"]): summary.get("resource_summary") or {} |