aboutsummaryrefslogtreecommitdiff
path: root/src/mod_stats.erl
diff options
context:
space:
mode:
authorAlexey Shchepin <alexey@process-one.net>2004-12-12 22:32:15 +0000
committerAlexey Shchepin <alexey@process-one.net>2004-12-12 22:32:15 +0000
commit0e9f506a91dfedd484ebc93aeb950e22f63ffe41 (patch)
treeebe1bbd7e1979bf73af5fae8a942499ba0c430cd /src/mod_stats.erl
parent* src/ejabberd_sm.erl: Added unset_presence_hook (diff)
* src/mod_stats.erl: Minor optimizations
SVN Revision: 291
Diffstat (limited to 'src/mod_stats.erl')
-rw-r--r--src/mod_stats.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mod_stats.erl b/src/mod_stats.erl
index 629e92e7b..ca4b57335 100644
--- a/src/mod_stats.erl
+++ b/src/mod_stats.erl
@@ -122,18 +122,18 @@ get_local_stats(_, _) ->
% ?STATVAL(io_lib:format("~.3f", [element(1, statistics(runtime))/1000]),
% "seconds");
get_local_stat([], Name) when Name == "users/online" ->
- case catch ejabberd_sm:dirty_get_sessions_list() of
+ case catch mnesia:table_info(session, size) of
{'EXIT', Reason} ->
?STATERR("500", "Internal Server Error");
Users ->
- ?STATVAL(integer_to_list(length(Users)), "users")
+ ?STATVAL(integer_to_list(Users), "users")
end;
get_local_stat([], Name) when Name == "users/total" ->
- case catch ejabberd_auth:dirty_get_registered_users() of
+ case catch mnesia:table_info(passwd, size) of
{'EXIT', Reason} ->
?STATERR("500", "Internal Server Error");
Users ->
- ?STATVAL(integer_to_list(length(Users)), "users")
+ ?STATVAL(integer_to_list(Users), "users")
end;
get_local_stat(_, Name) ->
?STATERR("404", "Not Found").