From 354ae6f398a251c9064522f0c3c8e222bae674c2 Mon Sep 17 00:00:00 2001 From: Feng Date: Thu, 1 Oct 2015 11:23:24 +0800 Subject: [PATCH] sort --- src/emqttd_stats.erl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/emqttd_stats.erl b/src/emqttd_stats.erl index bfdf5209d..345dc2d26 100644 --- a/src/emqttd_stats.erl +++ b/src/emqttd_stats.erl @@ -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