Merge pull request #66 from hamano/fix_mod_admin_extra_stats

fix mod_admin_extra stats command
This commit is contained in:
badlop 2015-01-28 09:29:37 +01:00
commit b7a7d9ae16
1 changed files with 2 additions and 2 deletions

View File

@ -1425,14 +1425,14 @@ privacy_set(Username, Host, QueryS) ->
stats(Name) ->
case Name of
<<"uptimeseconds">> -> trunc(element(1, erlang:statistics(wall_clock))/1000);
<<"registeredusers">> -> length(ejabberd_auth:dirty_get_registered_users());
<<"registeredusers">> -> lists:foldl(fun(Host, Sum) -> ejabberd_auth:get_vh_registered_users_number(Host) + Sum end, 0, ?MYHOSTS);
<<"onlineusersnode">> -> length(ejabberd_sm:dirty_get_my_sessions_list());
<<"onlineusers">> -> length(ejabberd_sm:dirty_get_sessions_list())
end.
stats(Name, Host) ->
case Name of
<<"registeredusers">> -> length(ejabberd_auth:get_vh_registered_users(Host));
<<"registeredusers">> -> ejabberd_auth:get_vh_registered_users_number(Host);
<<"onlineusers">> -> length(ejabberd_sm:get_vh_session_list(Host))
end.