MCPcopy Create free account
hub / github.com/Dizzy-K/AutoPT / export_summary_rows

Function export_summary_rows

analysis/summary.py:122–149  ·  view source on GitHub ↗
(summary: dict[str, Any])

Source from the content-addressed store, hash-verified

120
121
122def export_summary_rows(summary: dict[str, Any]) -> list[dict[str, Any]]:
123 rows: list[dict[str, Any]] = []
124 for category, table in summary.get("tables", {}).items():
125 if not isinstance(table, dict):
126 continue
127 for name, metrics in table.items():
128 if not isinstance(metrics, dict):
129 continue
130 row = {
131 "Category": category,
132 "Name": name,
133 "Count": metrics.get("total", 0),
134 "Failed": metrics.get("failed", 0),
135 "Success": metrics.get("success", 0),
136 "Error": metrics.get("error", 0),
137 "Other": metrics.get("other", 0),
138 "Ratio": f"{float(metrics.get('success_rate', 0.0)):.2%}",
139 "TotalRuntime": metrics.get("total_runtime"),
140 "AverageRuntime": metrics.get("average_runtime"),
141 }
142 if "attempt_total" in metrics:
143 row["AttemptTotal"] = metrics["attempt_total"]
144 if "k_min" in metrics:
145 row["KMin"] = metrics["k_min"]
146 if "k_max" in metrics:
147 row["KMax"] = metrics["k_max"]
148 rows.append(row)
149 return rows
150
151
152def build_metric_matrix(

Callers 1

handle_analysis_commandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected