MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / summarize

Function summarize

benchmarking/vllm/parse_engine_stats.py:98–119  ·  view source on GitHub ↗
(runs: list[BenchRun])

Source from the content-addressed store, hash-verified

96
97
98def summarize(runs: list[BenchRun]) -> pd.DataFrame:
99 rows = []
100 for run in runs:
101 s = (
102 pd.DataFrame(run.stats)
103 if run.stats
104 else pd.DataFrame({"running": [], "waiting": [], "kv_cache_pct": []})
105 )
106 rows.append(
107 {
108 "concurrency": run.max_concurrency,
109 "run": run.run_number,
110 "n_logs": len(s),
111 "kv_mean": s["kv_cache_pct"].mean() if len(s) else 0,
112 "kv_max": s["kv_cache_pct"].max() if len(s) else 0,
113 "running_mean": s["running"].mean() if len(s) else 0,
114 "running_max": s["running"].max() if len(s) else 0,
115 "waiting_mean": s["waiting"].mean() if len(s) else 0,
116 "waiting_max": s["waiting"].max() if len(s) else 0,
117 }
118 )
119 return pd.DataFrame(rows)
120
121
122def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected