跳转到内容

Test 测试插件

默认基地址:http://localhost:8180,前缀:/test

方法路径说明
GET/test/当前任务列表
GET/test/integration集成测试任务列表
GET/test/stress压测任务列表
GET/test/cases测试用例列表
GET/test/api/cases测试用例列表(带统一响应)
GET/test/api/stress/count压测推拉流数量统计
POST/test/api/cases/execute执行测试用例
POST/test/api/stress/push/{protocol}/{count}启动/调整推流压测
POST/test/api/stress/pull/{protocol}/{count}启动/调整拉流压测
POST/test/api/stress/stop/push停止推流压测
POST/test/api/stress/stop/pull停止拉流压测
POST/test/stop停止指定任务

返回当前任务列表。

响应字段:

字段类型说明
jobsarray任务数组
countint任务数量

返回推流/拉流压测数量统计。

响应示例:

{
"code": 0,
"message": "success",
"data": {
"pushCount": 10,
"pullCount": 20
}
}
POST /test/api/cases/execute
Content-Type: application/json
{ "names": ["basic_rtmp_to_flv", "webrtc_publish"] }
字段类型必填说明
namesstring[]要执行的测试用例名列表

4) POST /test/api/stress/push/{protocol}/{count}

Section titled “4) POST /test/api/stress/push/{protocol}/{count}”
POST /test/api/stress/push/rtmp/100
Content-Type: application/json
{
"remoteURL": "rtmp://localhost/live/stress/%d",
"streamPath": "live/source"
}

路径参数:

参数类型必填说明
protocolstringrtmp/rtsp/webrtc
countint目标推流并发数

请求体字段:

字段类型必填说明
remoteURLstring目标地址,可含 %d 占位
streamPathstring源流路径,默认 live/source

5) POST /test/api/stress/pull/{protocol}/{count}

Section titled “5) POST /test/api/stress/pull/{protocol}/{count}”
POST /test/api/stress/pull/rtmp/100
Content-Type: application/json
{
"remoteURL": "rtmp://localhost/live/source",
"testMode": 0
}

请求体字段:

字段类型必填说明
remoteURLstring拉流源地址,可含 %d
testModeint测试模式,默认 0
{ "id": 123 }
字段类型必填说明
iduint64任务 ID
{
"code": 0,
"message": "success",
"data": {
"pushCount": 100,
"protocol": "rtmp"
}
}
HTTP 状态码场景
400参数错误(如 count 非数字)
404路径不存在
500Stream manager / service registry 不可用

联系我们

微信公众号:不卡科技 微信公众号二维码
腾讯频道:流媒体技术 腾讯频道二维码
QQ 频道:p0qq0crz08 QQ 频道二维码
QQ 群:751639168 QQ 群二维码