Update the topic's statistics

This commit is contained in:
Feng Lee 2017-12-01 09:10:46 +08:00
parent ee5c33d0bd
commit d9500412bf
2 changed files with 6 additions and 4 deletions

View File

@ -284,5 +284,7 @@ clean_routes_(Node) ->
mnesia:transaction(Clean).
update_stats_() ->
emqttd_stats:setstats('routes/count', 'routes/max', mnesia:table_info(mqtt_route, size)).
Size = mnesia:table_info(mqtt_route, size),
emqttd_stats:setstats('routes/count', 'routes/max', Size),
emqttd_stats:setstats('topics/count', 'topics/max', Size).

View File

@ -57,14 +57,14 @@
%% $SYS Topics for Subscribers
-define(SYSTOP_PUBSUB, [
'routes/count', % ...
'routes/max', % ...
'topics/count', % ...
'topics/max', % ...
'subscribers/count', % ...
'subscribers/max', % ...
'subscriptions/count', % ...
'subscriptions/max' % ...
'subscriptions/max', % ...
'routes/count', % ...
'routes/max' % ...
]).
%% $SYS Topic for retained