This commit is contained in:
Feng 2015-10-01 11:23:24 +08:00
parent 14d2de3b05
commit 354ae6f398
1 changed files with 6 additions and 5 deletions

View File

@ -31,12 +31,12 @@
-include("emqttd.hrl").
-export([start_link/0]).
-behaviour(gen_server).
-define(SERVER, ?MODULE).
-export([start_link/0]).
%% statistics API.
-export([statsfun/1, statsfun/2,
getstats/0, getstat/1,
@ -52,8 +52,8 @@
%% $SYS Topics for Clients
-define(SYSTOP_CLIENTS, [
'clients/count', % clients connected current
'clients/max' % max clients connected
'clients/count', % clients connected current
'clients/max' % max clients connected
]).
%% $SYS Topics for Sessions
@ -72,6 +72,7 @@
'queues/max' % ...
]).
%%%=============================================================================
%%% API
%%%=============================================================================
@ -102,7 +103,7 @@ statsfun(Stat, MaxStat) ->
%%------------------------------------------------------------------------------
-spec getstats() -> [{atom(), non_neg_integer()}].
getstats() ->
ets:tab2list(?STATS_TAB).
lists:sort(ets:tab2list(?STATS_TAB)).
%%------------------------------------------------------------------------------
%% @doc Get stats by name