收发报文统计
获取集群收发报文统计
API 定义:
GET api/v3/metrics/
请求示例:
GET api/v3/metrics/
返回数据:
{
"code": 0,
"data": [
{
"node": "emqx@127.0.0.1",
"metrics": {
"bytes/received": 342,
"packets/pubrel/sent": 0,
"packets/pubcomp/missed": 0,
"packets/sent": 13,
"packets/pubrel/received": 0,
"messages/qos1/received": 0,
"packets/publish/received": 2,
"packets/auth": 0,
"messages/qos0/received": 2,
"packets/pubcomp/received": 0,
"packets/unsuback": 0,
"packets/pubrec/missed": 0,
"messages/qos1/sent": 0,
"messages/qos2/sent": 0,
"bytes/sent": 116,
"messages/received": 2,
"messages/dropped": 1,
"messages/qos2/received": 0,
"packets/connect": 5,
"messages/qos0/sent": 4,
"packets/disconnect/received": 0,
"packets/pubrec/sent": 0,
"packets/publish/sent": 4,
"packets/pubrec/received": 0,
"packets/received": 11,
"packets/unsubscribe": 0,
"packets/subscribe": 4,
"packets/disconnect/sent": 0,
"packets/pingresp": 0,
"messages/qos2/dropped": 0,
"packets/puback/missed": 0,
"packets/pingreq": 0,
"packets/connack": 5,
"packets/pubrel/missed": 0,
"messages/sent": 4,
"packets/suback": 4,
"messages/retained": 3,
"packets/puback/sent": 0,
"packets/puback/received": 0,
"messages/qos2/expired": 0,
"messages/forward": 0,
"messages/expired": 0,
"packets/pubcomp/sent": 0
}
}
]
}
获取节点收发报文统计
API 定义:
GET api/v3/nodes/${node}/metrics/
请求示例:
GET api/v3/nodes/emqx@127.0.0.1/metrics/
返回数据:
{
"code": 0,
"data": {
"bytes/received": 342,
"packets/pubrel/sent": 0,
"packets/pubcomp/missed": 0,
"packets/sent": 13,
"packets/pubrel/received": 0,
"messages/qos1/received": 0,
"packets/publish/received": 2,
"packets/auth": 0,
"messages/qos0/received": 2,
"packets/pubcomp/received": 0,
"packets/unsuback": 0,
"packets/pubrec/missed": 0,
"messages/qos1/sent": 0,
"messages/qos2/sent": 0,
"bytes/sent": 116,
"messages/received": 2,
"messages/dropped": 1,
"messages/qos2/received": 0,
"packets/connect": 5,
"messages/qos0/sent": 4,
"packets/disconnect/received": 0,
"packets/pubrec/sent": 0,
"packets/publish/sent": 4,
"packets/pubrec/received": 0,
"packets/received": 11,
"packets/unsubscribe": 0,
"packets/subscribe": 4,
"packets/disconnect/sent": 0,
"packets/pingresp": 0,
"messages/qos2/dropped": 0,
"packets/puback/missed": 0,
"packets/pingreq": 0,
"packets/connack": 5,
"packets/pubrel/missed": 0,
"messages/sent": 4,
"packets/suback": 4,
"messages/retained": 3,
"packets/puback/sent": 0,
"packets/puback/received": 0,
"messages/qos2/expired": 0,
"messages/forward": 0,
"messages/expired": 0,
"packets/pubcomp/sent": 0
}
}