feat: add 'live_connections' field in the /nodes API

This commit is contained in:
Shawn 2023-05-29 23:38:01 +08:00
parent abbea11a44
commit ab376fa141
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{application, emqx_management, {application, emqx_management,
[{description, "EMQX Management API and CLI"}, [{description, "EMQX Management API and CLI"},
{vsn, "4.4.14"}, % strict semver, bump manually! {vsn, "4.4.15"}, % strict semver, bump manually!
{modules, []}, {modules, []},
{registered, [emqx_management_sup]}, {registered, [emqx_management_sup]},
{applications, [kernel,stdlib,emqx_plugin_libs,minirest]}, {applications, [kernel,stdlib,emqx_plugin_libs,minirest]},

View File

@ -152,6 +152,7 @@ node_info(Node) when Node =:= node() ->
max_fds => proplists:get_value(max_fds, max_fds => proplists:get_value(max_fds,
lists:usort(lists:flatten(erlang:system_info(check_io)))), lists:usort(lists:flatten(erlang:system_info(check_io)))),
connections => ets:info(emqx_channel, size), connections => ets:info(emqx_channel, size),
live_connections => emqx_cm:get_connected_client_count(),
node_status => 'Running', node_status => 'Running',
uptime => iolist_to_binary(proplists:get_value(uptime, BrokerInfo)), uptime => iolist_to_binary(proplists:get_value(uptime, BrokerInfo)),
version => iolist_to_binary(proplists:get_value(version, BrokerInfo)) version => iolist_to_binary(proplists:get_value(version, BrokerInfo))