broker 命令
broker 命令查询服务器基本信息,启动时间,统计数据与性能数据。
broker | 查询 EMQ X 消息服务器描述、版本、启动时间 |
---|---|
broker stats | 查询连接(Connection)、会话(Session)、主题(Topic)、 订阅(Subscription)、路由(Route)统计信息 |
broker metrics | 查询 MQTT 报文(Packet)、消息(Message)收发统计 |
查询 EMQ X 消息服务器基本信息包括版本、启动时间等:
$ ./bin/emqx_ctl broker
sysdescr : EMQ X Broker
version : v3.1.0
uptime : 25 seconds
datetime : 2019-04-29 10:42:10
broker stats
查询服务器客户端连接(Connections)、会话(Sessions)、主题(Topics)、订阅(Subscriptions)、路由(Routes)统计:
$ ./bin/emqx_ctl broker stats
actions/max : 2
connections/count : 1
connections/max : 1
resources/max : 0
retained/count : 2
retained/max : 2
routes/count : 0
routes/max : 0
rules/max : 0
sessions/count : 0
sessions/max : 0
sessions/persistent/count : 0
sessions/persistent/max : 0
suboptions/max : 0
subscribers/count : 0
subscribers/max : 1
subscriptions/count : 1
subscriptions/max : 0
subscriptions/shared/count : 0
subscriptions/shared/max : 0
topics/count : 0
topics/max : 0
broker metrics
查询服务器流量(Bytes)、MQTT 报文(Packets)、消息(Messages)收发统计:
$ ./bin/emqx_ctl broker metrics
bytes/received : 0
bytes/sent : 0
messages/dropped : 0
messages/expired : 0
messages/forward : 0
messages/qos0/received : 0
messages/qos0/sent : 0
messages/qos1/received : 0
messages/qos1/sent : 0
messages/qos2/dropped : 0
messages/qos2/expired : 0
messages/qos2/received : 0
messages/qos2/sent : 0
messages/received : 0
messages/retained : 3
messages/sent : 0
packets/auth : 0
packets/connack : 0
packets/connect : 0
packets/disconnect/recei: 0
packets/disconnect/sent : 0
packets/pingreq : 0
packets/pingresp : 0
packets/puback/missed : 0
packets/puback/received : 0
packets/puback/sent : 0
packets/pubcomp/missed : 0
packets/pubcomp/received: 0
packets/pubcomp/sent : 0
packets/publish/received: 0
packets/publish/sent : 0
packets/pubrec/missed : 0
packets/pubrec/received : 0
packets/pubrec/sent : 0
packets/pubrel/missed : 0
packets/pubrel/received : 0
packets/pubrel/sent : 0
packets/received : 0
packets/sent : 0
packets/suback : 0
packets/subscribe : 0
packets/unsuback : 0
packets/unsubscribe : 0