Report 上报插件
默认基地址:http://localhost:8180,前缀:/report
| 方法 | 路径 | 说明 |
|---|---|---|
| POST | /report/metrics | 写入指标 |
| GET | /report/rooms | 房间列表 |
| GET | /report/metrics/{room_id} | 房间指标聚合 |
| GET | /report/metrics/{room_id}/{user_id} | 单用户指标 |
| GET | /report/history/{room_id} | 房间历史指标 |
逐接口详细说明
Section titled “逐接口详细说明”1) POST /report/metrics
Section titled “1) POST /report/metrics”POST /report/metricsContent-Type: application/json{ "user_id": "u1", "room_id": "room-1", "sdk_version": "1.2.0", "report_time": 1746616000, "metrics": [ { "user_id": "u1", "streams": [ { "stream_id": "camera", "direction": "send", "video": { "timestamp": 1746616000, "frame_rate": 25, "width": 1280, "height": 720, "bitrate": 1200 }, "audio": { "timestamp": 1746616000, "sample_rate": 48000, "channels": 2, "bitrate": 64 }, "network": { "rtt": 45, "packet_loss": 0.3, "jitter": 8 } } ] } ]}字段定义:
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
user_id | string | 是 | 上报用户 ID |
room_id | string | 是 | 房间 ID |
sdk_version | string | 是 | SDK 版本 |
report_time | int64 | 是 | Unix 时间戳 |
metrics | object[] | 是 | 用户指标集合 |
2) GET /report/rooms
Section titled “2) GET /report/rooms”返回当前有指标数据的房间 ID 列表。
3) GET /report/metrics/{room_id}
Section titled “3) GET /report/metrics/{room_id}”| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
room_id | string | 是 | 房间 ID |
返回房间聚合指标与用户指标列表。
4) GET /report/metrics/{room_id}/{user_id}
Section titled “4) GET /report/metrics/{room_id}/{user_id}”| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
room_id | string | 是 | 房间 ID |
user_id | string | 是 | 用户 ID |
返回单用户最新指标。
5) GET /report/history/{room_id}
Section titled “5) GET /report/history/{room_id}”返回房间历史指标快照。
通用响应示例
Section titled “通用响应示例”{ "code": 0, "message": "success", "data": null}| HTTP 状态码 | 场景 |
|---|---|
| 400 | JSON 格式非法 |
| 404 | 房间或用户不存在 |
联系我们
微信公众号:不卡科技
腾讯频道:流媒体技术
QQ 频道:p0qq0crz08
QQ 群:751639168