连接会话统计

获取集群连接会话统计

API 定义:

  1. GET api/v3/stats/

请求示例:

  1. GET api/v3/stats/

返回数据:

  1. {
  2. "code": 0,
  3. "data": [
  4. {
  5. "node": "emqx@127.0.0.1",
  6. "subscriptions/shared/max": 0,
  7. "subscriptions/max": 2,
  8. "subscribers/max": 2,
  9. "topics/count": 0,
  10. "subscriptions/count": 0,
  11. "topics/max": 1,
  12. "sessions/persistent/max": 2,
  13. "connections/max": 2,
  14. "subscriptions/shared/count": 0,
  15. "sessions/persistent/count": 0,
  16. "retained/count": 3,
  17. "routes/count": 0,
  18. "sessions/count": 0,
  19. "retained/max": 3,
  20. "sessions/max": 2,
  21. "routes/max": 1,
  22. "subscribers/count": 0,
  23. "connections/count": 0
  24. }
  25. ]
  26. }

获取节点连接会话统计

API 定义:

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

请求示例:

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

返回数据:

  1. {
  2. "code": 0,
  3. "data": {
  4. "subscriptions/shared/max": 0,
  5. "subscriptions/max": 2,
  6. "subscribers/max": 2,
  7. "topics/count": 0,
  8. "subscriptions/count": 0,
  9. "topics/max": 1,
  10. "sessions/persistent/max": 2,
  11. "connections/max": 2,
  12. "subscriptions/shared/count": 0,
  13. "sessions/persistent/count": 0,
  14. "retained/count": 3,
  15. "routes/count": 0,
  16. "sessions/count": 0,
  17. "retained/max": 3,
  18. "sessions/max": 2,
  19. "routes/max": 1,
  20. "subscribers/count": 0,
  21. "connections/count": 0
  22. }
  23. }