summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog2
-rw-r--r--src/mod_stats.erl8
2 files changed, 6 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7f57a5a7..997126e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2004-12-12 Alexey Shchepin <alexey@sevcom.net>
+ * src/mod_stats.erl: Minor optimizations
+
* src/ejabberd_sm.erl: Added unset_presence_hook
* src/mod_last.erl: Use unset_presence_hook instead of direct call
diff --git a/src/mod_stats.erl b/src/mod_stats.erl
index 629e92e7..ca4b5733 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").