chore(recon): rename to emqx_ctl observer status

This commit is contained in:
zhongwencool 2021-08-24 17:23:29 +08:00 committed by turtleDeng
parent 6957445554
commit f4e3eeb2b2
1 changed files with 6 additions and 4 deletions

View File

@ -27,12 +27,14 @@
%% enable/disable %% enable/disable
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
enable() -> enable() ->
emqx_ctl:register_command(recon, {?MODULE, cmd}, []). emqx_ctl:register_command(recon, {?MODULE, cmd}, []),
emqx_ctl:register_command(observer, {?MODULE, cmd}, []).
disable() -> disable() ->
emqx_ctl:unregister_command(recon). emqx_ctl:unregister_command(recon),
emqx_ctl:unregister_command(observer).
cmd(["observer_cli"]) -> cmd(["status"]) ->
observer_cli:start(); observer_cli:start();
cmd(["memory"]) -> cmd(["memory"]) ->
Print = fun(Key, Keyword) -> Print = fun(Key, Keyword) ->
@ -58,7 +60,7 @@ cmd(["proc_count", Attr, N]) ->
emqx_ctl:print("~p~n", [recon:proc_count(list_to_atom(Attr), list_to_integer(N))]); emqx_ctl:print("~p~n", [recon:proc_count(list_to_atom(Attr), list_to_integer(N))]);
cmd(_) -> cmd(_) ->
emqx_ctl:usage([{"observer_cli", "observer_cli:start()"}, emqx_ctl:usage([{"observer status", "observer_cli:start()"},
{"recon memory", "recon_alloc:memory/2"}, {"recon memory", "recon_alloc:memory/2"},
{"recon allocated", "recon_alloc:memory(allocated_types, current|max)"}, {"recon allocated", "recon_alloc:memory(allocated_types, current|max)"},
{"recon bin_leak", "recon:bin_leak(100)"}, {"recon bin_leak", "recon:bin_leak(100)"},