e4721053bd
- 新增异常处理体系(BaseException及其子类) - 优化密码、邮箱、用户名等基础类型 - 添加字典管理、登录日志、操作日志的E2E测试 - 完善API集成测试和安全测试 - 添加性能测试配置和脚本 - 优化OpenAPI配置和全局异常处理器
155 lines
4.4 KiB
JSON
155 lines
4.4 KiB
JSON
{
|
||
"name": "Novalon管理系统性能测试",
|
||
"stages": [
|
||
{
|
||
"name": "预热阶段",
|
||
"duration": "2m",
|
||
"target": 10,
|
||
"description": "2分钟内增加到10个虚拟用户"
|
||
},
|
||
{
|
||
"name": "稳定阶段1",
|
||
"duration": "5m",
|
||
"target": 10,
|
||
"description": "保持10个虚拟用户5分钟"
|
||
},
|
||
{
|
||
"name": "负载增加阶段",
|
||
"duration": "2m",
|
||
"target": 50,
|
||
"description": "2分钟内增加到50个虚拟用户"
|
||
},
|
||
{
|
||
"name": "稳定阶段2",
|
||
"duration": "5m",
|
||
"target": 50,
|
||
"description": "保持50个虚拟用户5分钟"
|
||
},
|
||
{
|
||
"name": "高负载阶段",
|
||
"duration": "2m",
|
||
"target": 100,
|
||
"description": "2分钟内增加到100个虚拟用户"
|
||
},
|
||
{
|
||
"name": "稳定阶段3",
|
||
"duration": "5m",
|
||
"target": 100,
|
||
"description": "保持100个虚拟用户5分钟"
|
||
},
|
||
{
|
||
"name": "冷却阶段",
|
||
"duration": "2m",
|
||
"target": 0,
|
||
"description": "2分钟内降到0个虚拟用户"
|
||
}
|
||
],
|
||
"thresholds": {
|
||
"http_req_duration": {
|
||
"p95": "<500",
|
||
"p99": "<1000",
|
||
"description": "95%的请求响应时间<500ms,99%的请求响应时间<1000ms"
|
||
},
|
||
"http_req_failed": {
|
||
"rate": "<0.01",
|
||
"description": "错误率<1%"
|
||
},
|
||
"http_reqs": {
|
||
"rate": ">100",
|
||
"description": "请求速率>100请求/秒"
|
||
}
|
||
},
|
||
"endpoints": [
|
||
{
|
||
"name": "健康检查",
|
||
"method": "GET",
|
||
"path": "/actuator/health",
|
||
"expected_status": 200,
|
||
"max_duration": 100,
|
||
"description": "后端健康检查接口"
|
||
},
|
||
{
|
||
"name": "登录",
|
||
"method": "POST",
|
||
"path": "/api/auth/login",
|
||
"expected_status": 200,
|
||
"max_duration": 500,
|
||
"description": "用户登录接口"
|
||
},
|
||
{
|
||
"name": "用户列表",
|
||
"method": "GET",
|
||
"path": "/api/users?page=0&size=10",
|
||
"expected_status": 200,
|
||
"max_duration": 300,
|
||
"description": "获取用户列表接口"
|
||
},
|
||
{
|
||
"name": "角色列表",
|
||
"method": "GET",
|
||
"path": "/api/roles?page=0&size=10",
|
||
"expected_status": 200,
|
||
"max_duration": 300,
|
||
"description": "获取角色列表接口"
|
||
},
|
||
{
|
||
"name": "字典列表",
|
||
"method": "GET",
|
||
"path": "/api/dicts?page=0&size=10",
|
||
"expected_status": 200,
|
||
"max_duration": 300,
|
||
"description": "获取字典列表接口"
|
||
},
|
||
{
|
||
"name": "系统配置",
|
||
"method": "GET",
|
||
"path": "/api/configs?page=0&size=10",
|
||
"expected_status": 200,
|
||
"max_duration": 300,
|
||
"description": "获取系统配置接口"
|
||
},
|
||
{
|
||
"name": "通知列表",
|
||
"method": "GET",
|
||
"path": "/api/notices?page=0&size=10",
|
||
"expected_status": 200,
|
||
"max_duration": 300,
|
||
"description": "获取通知列表接口"
|
||
},
|
||
{
|
||
"name": "操作日志",
|
||
"method": "GET",
|
||
"path": "/api/operation-logs?page=0&size=10",
|
||
"expected_status": 200,
|
||
"max_duration": 300,
|
||
"description": "获取操作日志接口"
|
||
}
|
||
],
|
||
"scenarios": {
|
||
"basic": {
|
||
"name": "基础性能测试",
|
||
"description": "测试系统在低负载下的性能表现",
|
||
"stages": ["预热阶段", "稳定阶段1", "冷却阶段"],
|
||
"endpoints": ["健康检查", "登录", "用户列表"]
|
||
},
|
||
"moderate": {
|
||
"name": "中等负载测试",
|
||
"description": "测试系统在中负载下的性能表现",
|
||
"stages": ["预热阶段", "稳定阶段1", "负载增加阶段", "稳定阶段2", "冷却阶段"],
|
||
"endpoints": ["健康检查", "登录", "用户列表", "角色列表", "字典列表"]
|
||
},
|
||
"high": {
|
||
"name": "高负载测试",
|
||
"description": "测试系统在高负载下的性能表现",
|
||
"stages": ["预热阶段", "稳定阶段1", "负载增加阶段", "稳定阶段2", "高负载阶段", "稳定阶段3", "冷却阶段"],
|
||
"endpoints": ["健康检查", "登录", "用户列表", "角色列表", "字典列表", "系统配置", "通知列表", "操作日志"]
|
||
},
|
||
"stress": {
|
||
"name": "压力测试",
|
||
"description": "测试系统在极限负载下的性能表现",
|
||
"stages": ["高负载阶段", "稳定阶段3", "冷却阶段"],
|
||
"endpoints": ["健康检查", "登录", "用户列表", "角色列表", "字典列表", "系统配置", "通知列表", "操作日志"]
|
||
}
|
||
}
|
||
}
|