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 : 4.0.0
  4. uptime : 4 minutes, 52 seconds
  5. datetime : 2020-02-21 09:39:58

broker stats

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

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

broker metrics

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

  1. $ ./bin/emqx_ctl broker metrics
  2. actions.success : 0
  3. bytes.received : 0
  4. bytes.sent : 0
  5. client.auth.anonymous : 0
  6. client.authenticate : 0
  7. client.check_acl : 0
  8. client.connack : 0
  9. client.connect : 0
  10. client.connected : 0
  11. client.disconnected : 0
  12. client.subscribe : 0
  13. client.unsubscribe : 0
  14. delivery.dropped : 0
  15. delivery.dropped.expired : 0
  16. delivery.dropped.no_local : 0
  17. delivery.dropped.qos0_msg : 0
  18. delivery.dropped.queue_full : 0
  19. delivery.dropped.too_large : 0
  20. messages.acked : 0
  21. messages.delayed : 0
  22. messages.delivered : 0
  23. messages.dropped : 0
  24. messages.dropped.expired : 0
  25. messages.dropped.no_subscriber: 0
  26. messages.forward : 0
  27. messages.publish : 0
  28. messages.qos0.received : 0
  29. messages.qos0.sent : 0
  30. messages.qos1.received : 0
  31. messages.qos1.sent : 0
  32. messages.qos2.received : 0
  33. messages.qos2.sent : 0
  34. messages.received : 0
  35. messages.retained : 3
  36. messages.sent : 0
  37. packets.auth.received : 0
  38. packets.auth.sent : 0
  39. packets.connack.auth_error : 0
  40. packets.connack.error : 0
  41. packets.connack.sent : 0
  42. packets.connect.received : 0
  43. packets.disconnect.received : 0
  44. packets.disconnect.sent : 0
  45. packets.pingreq.received : 0
  46. packets.pingresp.sent : 0
  47. packets.puback.inuse : 0
  48. packets.puback.missed : 0
  49. packets.puback.received : 0
  50. packets.puback.sent : 0
  51. packets.pubcomp.inuse : 0
  52. packets.pubcomp.missed : 0
  53. packets.pubcomp.received : 0
  54. packets.pubcomp.sent : 0
  55. packets.publish.auth_error : 0
  56. packets.publish.dropped : 0
  57. packets.publish.error : 0
  58. packets.publish.received : 0
  59. packets.publish.sent : 0
  60. packets.pubrec.inuse : 0
  61. packets.pubrec.missed : 0
  62. packets.pubrec.received : 0
  63. packets.pubrec.sent : 0
  64. packets.pubrel.missed : 0
  65. packets.pubrel.received : 0
  66. packets.pubrel.sent : 0
  67. packets.received : 0
  68. packets.sent : 0
  69. packets.suback.sent : 0
  70. packets.subscribe.auth_error : 0
  71. packets.subscribe.error : 0
  72. packets.subscribe.received : 0
  73. packets.unsuback.sent : 0
  74. packets.unsubscribe.error : 0
  75. packets.unsubscribe.received : 0
  76. rules.matched : 0
  77. session.created : 0
  78. session.discarded : 0
  79. session.resumed : 0
  80. session.takeovered : 0
  81. session.terminated : 0