%%%% get_stats
get_stats(global, Lang) ->
- OnlineUsers = mnesia:table_info(session, size),
+ OnlineUsers = ejabberd_sm:connected_users_number(),
RegisteredUsers = lists:foldl(fun (Host, Total) ->
ejabberd_auth:get_vh_registered_users_number(Host)
+ Total
CPUTime = ejabberd_cluster:call(Node, erlang, statistics, [runtime]),
CPUTimeS = list_to_binary(io_lib:format("~.3f",
[element(1, CPUTime) / 1000])),
- OnlineUsers = mnesia:table_info(session, size),
+ OnlineUsers = ejabberd_sm:connected_users_number(),
TransactionsCommitted = ejabberd_cluster:call(Node, mnesia,
system_info, [transaction_commits]),
TransactionsAborted = ejabberd_cluster:call(Node, mnesia,
end;
get_local_stat(_Server, [], Name)
when Name == <<"users/all-hosts/online">> ->
- case catch mnesia:table_info(session, size) of
- {'EXIT', _Reason} ->
- ?STATERR(<<"500">>, <<"Internal Server Error">>);
- Users ->
- ?STATVAL((iolist_to_binary(integer_to_list(Users))),
- <<"users">>)
- end;
+ Users = ejabberd_sm:connected_users_number(),
+ ?STATVAL((iolist_to_binary(integer_to_list(Users))), <<"users">>);
get_local_stat(_Server, [], Name)
when Name == <<"users/all-hosts/total">> ->
NumUsers = lists:foldl(fun (Host, Total) ->