服务指标接口(JSON格式)
接口功能
获取推理服务过程中请求的TTFT、TBT的动态平均值(默认近1000个请求的平均值),正在执行请求数、正在等待请求数量、剩余NPUblock数量。
接口格式
操作类型:GET
URL:https://{ip}:{port}/metrics-json
- {ip}字段优先读取环境变量值MIES_CONTAINER_MANAGEMENT_IP;如果没有该环境变量,则取配置文件的“managementIpAddress”参数;如果配置文件中没有“managementIpAddress”参数,则取配置文件的“ipAddress”参数。
- {port}字段优先读取配置文件的“managementPort”参数;如果配置文件中没有“managementPort”参数,则取配置文件的“port”参数。
请求参数
无
使用样例
请求样例:
GET https://{ip}:{port}/metrics-json
响应样例:
{
"resultType": "vector",
"result": [
{
"metric": [
{
"__name__": "TTFT",
"job": "node",
"instance": "127.0.0.2:1026"
}
],
"value": "0"
},
{
"metric": [
{
"__name__": "TBT",
"job": "node",
"instance": "127.0.0.2:1026"
}
],
"value": "0"
},
{
"metric": [
{
"__name__": "waitingInferRequestNum",
"job": "node",
"instance": "127.0.0.2:1026"
}
],
"value": "0"
},
{
"metric": [
{
"__name__": "processingInferRequestNum",
"job": "node",
"instance": "127.0.0.2:1026"
}
],
"value": "0"
},
{
"metric": [
{
"__name__": "remainBlocks",
"job": "node",
"instance": "127.0.0.2:1026"
}
],
"value": "1024"
}
]
}
响应状态码:200
输出说明
返回值 |
类型 |
说明 |
||
|---|---|---|---|---|
resultType |
string |
结果类型,默认为vector,包含查询结果的数组。 |
||
result |
list |
结果列表。 |
||
- |
metric |
list |
五种服务指标结果。
|
|
- |
__name__ |
string |
服务指标的名称。 |
|
job |
string |
服务指标作业名称。 |
||
instance |
string |
服务指标实例地址。 |
||
value |
string |
服务指标结果具体值。 |
||
父主题: EndPoint管理面接口