broker 命令

broker 命令查询服务器基本信息,启动时间,统计数据与性能数据。

broker查询 EMQ X 消息服务器描述、版本、启动时间
broker stats查询连接(Connection)、会话(Session)、主题(Topic)、 订阅(Subscription)、路由(Route)统计信息
broker metrics查询 MQTT 报文(Packet)、消息(Message)收发统计

查询 EMQ X 消息服务器基本信息包括版本、启动时间等:

  1. $ ./bin/emqx_ctl broker
  2. sysdescr : EMQ X Broker
  3. version : v3.1.0
  4. uptime : 25 seconds
  5. datetime : 2019-04-29 10:42:10

broker stats

查询服务器客户端连接(Connections)、会话(Sessions)、主题(Topics)、订阅(Subscriptions)、路由(Routes)统计:

  1. $ ./bin/emqx_ctl broker stats
  2. actions/max : 2
  3. connections/count : 1
  4. connections/max : 1
  5. resources/max : 0
  6. retained/count : 2
  7. retained/max : 2
  8. routes/count : 0
  9. routes/max : 0
  10. rules/max : 0
  11. sessions/count : 0
  12. sessions/max : 0
  13. sessions/persistent/count : 0
  14. sessions/persistent/max : 0
  15. suboptions/max : 0
  16. subscribers/count : 0
  17. subscribers/max : 1
  18. subscriptions/count : 1
  19. subscriptions/max : 0
  20. subscriptions/shared/count : 0
  21. subscriptions/shared/max : 0
  22. topics/count : 0
  23. topics/max : 0

broker metrics

查询服务器流量(Bytes)、MQTT 报文(Packets)、消息(Messages)收发统计:

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