fix route, reverse_route stats
This commit is contained in:
parent
4f9d429478
commit
51c5ea1f96
|
@ -34,7 +34,7 @@
|
||||||
-define(CONCURRENCY_OPTS, [{read_concurrency, true}, {write_concurrency, true}]).
|
-define(CONCURRENCY_OPTS, [{read_concurrency, true}, {write_concurrency, true}]).
|
||||||
|
|
||||||
%% API
|
%% API
|
||||||
-export([start_link/0]).
|
-export([start_link/0, pubsub_pool/0]).
|
||||||
|
|
||||||
%% Supervisor callbacks
|
%% Supervisor callbacks
|
||||||
-export([init/1]).
|
-export([init/1]).
|
||||||
|
@ -42,6 +42,9 @@
|
||||||
start_link() ->
|
start_link() ->
|
||||||
supervisor:start_link({local, ?MODULE}, ?MODULE, [emqttd_broker:env(pubsub)]).
|
supervisor:start_link({local, ?MODULE}, ?MODULE, [emqttd_broker:env(pubsub)]).
|
||||||
|
|
||||||
|
pubsub_pool() ->
|
||||||
|
hd([Pid|| {pubsub_pool, Pid, _, _} <- supervisor:which_children(?MODULE)]).
|
||||||
|
|
||||||
init([Env]) ->
|
init([Env]) ->
|
||||||
%% Create tabs
|
%% Create tabs
|
||||||
create_tab(route), create_tab(reverse_route),
|
create_tab(route), create_tab(reverse_route),
|
||||||
|
@ -83,6 +86,9 @@ pool_size(Env) ->
|
||||||
setstats(route) ->
|
setstats(route) ->
|
||||||
emqttd_stats:setstat('routes/count', ets:info(route, size));
|
emqttd_stats:setstat('routes/count', ets:info(route, size));
|
||||||
|
|
||||||
|
setstats(reverse_route) ->
|
||||||
|
emqttd_stats:setstat('routes/reverse', ets:info(reverse_route, size));
|
||||||
|
|
||||||
setstats(topic) ->
|
setstats(topic) ->
|
||||||
emqttd_stats:setstats('topics/count', 'topics/max', mnesia:table_info(topic, size));
|
emqttd_stats:setstats('topics/count', 'topics/max', mnesia:table_info(topic, size));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue