收发报文统计

获取集群收发报文统计

API 定义:

  1. GET api/v3/metrics/

请求示例:

  1. GET api/v3/metrics/

返回数据:

  1. {
  2. "code": 0,
  3. "data": [
  4. {
  5. "node": "emqx@127.0.0.1",
  6. "metrics": {
  7. "bytes/received": 342,
  8. "packets/pubrel/sent": 0,
  9. "packets/pubcomp/missed": 0,
  10. "packets/sent": 13,
  11. "packets/pubrel/received": 0,
  12. "messages/qos1/received": 0,
  13. "packets/publish/received": 2,
  14. "packets/auth": 0,
  15. "messages/qos0/received": 2,
  16. "packets/pubcomp/received": 0,
  17. "packets/unsuback": 0,
  18. "packets/pubrec/missed": 0,
  19. "messages/qos1/sent": 0,
  20. "messages/qos2/sent": 0,
  21. "bytes/sent": 116,
  22. "messages/received": 2,
  23. "messages/dropped": 1,
  24. "messages/qos2/received": 0,
  25. "packets/connect": 5,
  26. "messages/qos0/sent": 4,
  27. "packets/disconnect/received": 0,
  28. "packets/pubrec/sent": 0,
  29. "packets/publish/sent": 4,
  30. "packets/pubrec/received": 0,
  31. "packets/received": 11,
  32. "packets/unsubscribe": 0,
  33. "packets/subscribe": 4,
  34. "packets/disconnect/sent": 0,
  35. "packets/pingresp": 0,
  36. "messages/qos2/dropped": 0,
  37. "packets/puback/missed": 0,
  38. "packets/pingreq": 0,
  39. "packets/connack": 5,
  40. "packets/pubrel/missed": 0,
  41. "messages/sent": 4,
  42. "packets/suback": 4,
  43. "messages/retained": 3,
  44. "packets/puback/sent": 0,
  45. "packets/puback/received": 0,
  46. "messages/qos2/expired": 0,
  47. "messages/forward": 0,
  48. "messages/expired": 0,
  49. "packets/pubcomp/sent": 0
  50. }
  51. }
  52. ]
  53. }

获取节点收发报文统计

API 定义:

  1. GET api/v3/nodes/${node}/metrics/

请求示例:

  1. GET api/v3/nodes/emqx@127.0.0.1/metrics/

返回数据:

  1. {
  2. "code": 0,
  3. "data": {
  4. "bytes/received": 342,
  5. "packets/pubrel/sent": 0,
  6. "packets/pubcomp/missed": 0,
  7. "packets/sent": 13,
  8. "packets/pubrel/received": 0,
  9. "messages/qos1/received": 0,
  10. "packets/publish/received": 2,
  11. "packets/auth": 0,
  12. "messages/qos0/received": 2,
  13. "packets/pubcomp/received": 0,
  14. "packets/unsuback": 0,
  15. "packets/pubrec/missed": 0,
  16. "messages/qos1/sent": 0,
  17. "messages/qos2/sent": 0,
  18. "bytes/sent": 116,
  19. "messages/received": 2,
  20. "messages/dropped": 1,
  21. "messages/qos2/received": 0,
  22. "packets/connect": 5,
  23. "messages/qos0/sent": 4,
  24. "packets/disconnect/received": 0,
  25. "packets/pubrec/sent": 0,
  26. "packets/publish/sent": 4,
  27. "packets/pubrec/received": 0,
  28. "packets/received": 11,
  29. "packets/unsubscribe": 0,
  30. "packets/subscribe": 4,
  31. "packets/disconnect/sent": 0,
  32. "packets/pingresp": 0,
  33. "messages/qos2/dropped": 0,
  34. "packets/puback/missed": 0,
  35. "packets/pingreq": 0,
  36. "packets/connack": 5,
  37. "packets/pubrel/missed": 0,
  38. "messages/sent": 4,
  39. "packets/suback": 4,
  40. "messages/retained": 3,
  41. "packets/puback/sent": 0,
  42. "packets/puback/received": 0,
  43. "messages/qos2/expired": 0,
  44. "messages/forward": 0,
  45. "messages/expired": 0,
  46. "packets/pubcomp/sent": 0
  47. }
  48. }