GPU测试
This commit is contained in:
88
generate_stress_charts.py
Normal file
88
generate_stress_charts.py
Normal file
@@ -0,0 +1,88 @@
|
||||
"""
|
||||
压力测试结果可视化生成脚本
|
||||
|
||||
运行此脚本生成专业的可视化报表
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
# 添加当前目录到路径
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from benchmark.stress_visualizer import generate_stress_visualizations
|
||||
|
||||
def main():
|
||||
# 查找最新的结果文件
|
||||
stress_dir = Path("./stress_results")
|
||||
if not stress_dir.exists():
|
||||
print("❌ stress_results 目录不存在")
|
||||
return
|
||||
|
||||
# 查找 JSON 结果文件
|
||||
json_files = list(stress_dir.glob("stress_results_*.json"))
|
||||
if not json_files:
|
||||
print("❌ 未找到压力测试结果文件")
|
||||
return
|
||||
|
||||
# 使用最新的文件
|
||||
latest_file = max(json_files, key=lambda x: x.stat().st_mtime)
|
||||
|
||||
print("=" * 60)
|
||||
print("RTX 3050 压力测试可视化报表生成")
|
||||
print("=" * 60)
|
||||
print(f"📊 数据源: {latest_file}")
|
||||
print(f"📁 输出目录: {stress_dir}")
|
||||
print()
|
||||
|
||||
try:
|
||||
# 检查是否安装了 matplotlib
|
||||
try:
|
||||
import matplotlib
|
||||
import seaborn
|
||||
import pandas
|
||||
except ImportError as e:
|
||||
print("❌ 缺少必要的依赖包,请安装:")
|
||||
print(" pip install matplotlib seaborn pandas")
|
||||
return
|
||||
|
||||
# 生成图表
|
||||
print("🎨 正在生成可视化图表...")
|
||||
chart_files = generate_stress_visualizations(str(latest_file), str(stress_dir))
|
||||
|
||||
print(f"\n✅ 成功生成 {len(chart_files)} 个可视化图表:")
|
||||
print()
|
||||
|
||||
chart_descriptions = {
|
||||
"performance_dashboard.png": "📈 性能概览仪表板",
|
||||
"cameras_vs_fps.png": "📹 摄像头数量 vs 帧数分析",
|
||||
"gpu_utilization_analysis.png": "🔥 GPU 利用率深度分析",
|
||||
"latency_analysis.png": "⏱️ 延迟性能分析",
|
||||
"frame_skip_analysis.png": "🎯 抽帧策略效果分析",
|
||||
"deployment_heatmap.png": "🗺️ 部署配置建议热力图",
|
||||
"bottleneck_analysis.png": "🔍 性能瓶颈深度分析"
|
||||
}
|
||||
|
||||
for chart_file in chart_files:
|
||||
filename = Path(chart_file).name
|
||||
description = chart_descriptions.get(filename, "📊 图表")
|
||||
print(f" {description}")
|
||||
print(f" 文件: {chart_file}")
|
||||
print()
|
||||
|
||||
print("=" * 60)
|
||||
print("🎉 可视化报表生成完成!")
|
||||
print("💡 建议:")
|
||||
print(" 1. 查看 performance_dashboard.png 获得整体概览")
|
||||
print(" 2. 查看 bottleneck_analysis.png 了解优化方向")
|
||||
print(" 3. 查看 deployment_heatmap.png 选择部署配置")
|
||||
print("=" * 60)
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ 生成图表时出错: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user