MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / generate_report

Function generate_report

tests/ce/performance/stress_tools.py:122–136  ·  view source on GitHub ↗
(counter, latencies)

Source from the content-addressed store, hash-verified

120
121# ============ 报告输出 ============
122def generate_report(counter, latencies):
123 print("\n====== 压测报告 ======")
124 total = counter["success"] + counter["fail"]
125 print(f"总请求数: {total}")
126 print(f"成功数: {counter['success']}")
127 print(f"失败数: {counter['fail']}")
128 for k, v in counter.items():
129 if k.startswith("error_"):
130 print(f"{k}: {v}")
131 if latencies:
132 print(f"平均延迟: {mean(latencies):.4f}s")
133 print(f"中位延迟: {median(latencies):.4f}s")
134 print(f"最快: {min(latencies):.4f}s")
135 print(f"最慢: {max(latencies):.4f}s")
136 print("=====================")
137
138
139if __name__ == "__main__":

Callers 1

run_load_testFunction · 0.85

Calls 2

printFunction · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected