|
|
3 ヶ月 前 | |
|---|---|---|
| .. | ||
| reports | 3 ヶ月 前 | |
| README.md | 3 ヶ月 前 | |
| locustfile_backend.py | 3 ヶ月 前 | |
| locustfile_frontend.py | 3 ヶ月 前 | |
| requirements.txt | 3 ヶ月 前 | |
| run_backend_performance.ps1 | 3 ヶ月 前 | |
| run_frontend_performance.ps1 | 3 ヶ月 前 | |
使用 Locust 对后端接口和前端关键页面进行并发访问测试,验证系统在课程实践规模下的响应稳定性。
| 脚本 | 目标 | 默认 Host |
|---|---|---|
locustfile_backend.py |
后端接口性能测试 | http://localhost:3000 |
locustfile_frontend.py |
前端页面性能测试 | http://127.0.0.1:4301 |
安装依赖:
cd E:\软测\ServicePilot\tests\performance_tests
pip install -r requirements.txt
后端性能测试:
powershell -ExecutionPolicy Bypass -File .\run_backend_performance.ps1
前端性能测试:
powershell -ExecutionPolicy Bypass -File .\run_frontend_performance.ps1
| 指标 | 标准 |
|---|---|
| 查询类平均响应时间 | < 500ms |
| 查询类 P95 | < 1000ms |
| 错误率 | < 1% |
| 服务稳定性 | 压测期间不崩溃 |
tests/performance_tests/reports/backend-performance-report.html
tests/performance_tests/reports/backend-performance_*.csv
tests/performance_tests/reports/frontend-performance-report.html
tests/performance_tests/reports/frontend-performance_*.csv
如果未安装 Locust,运行脚本会生成 reports/*_performance_pending.txt,用于说明未执行原因和补跑命令。