25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Use homogeneous s2s connections stats (#761)

This commit is contained in:
Badlop 2015-10-21 12:51:22 +02:00
parent 8a2fa62cac
commit c62bd0c911

View File

@ -1478,10 +1478,8 @@ get_stats(global, Lang) ->
+ Total
end,
0, ?MYHOSTS),
S2SConns = ejabberd_s2s:dirty_get_connections(),
S2SConnections = length(S2SConns),
S2SServers = length(lists:usort([element(2, C)
|| C <- S2SConns])),
OutS2SNumber = ejabberd_s2s:outgoing_s2s_number(),
InS2SNumber = ejabberd_s2s:incoming_s2s_number(),
[?XAE(<<"table">>, [],
[?XE(<<"tbody">>,
[?XE(<<"tr">>,
@ -1492,10 +1490,10 @@ get_stats(global, Lang) ->
?XC(<<"td">>, (pretty_string_int(OnlineUsers)))]),
?XE(<<"tr">>,
[?XCT(<<"td">>, <<"Outgoing s2s Connections:">>),
?XC(<<"td">>, (pretty_string_int(S2SConnections)))]),
?XC(<<"td">>, (pretty_string_int(OutS2SNumber)))]),
?XE(<<"tr">>,
[?XCT(<<"td">>, <<"Outgoing s2s Servers:">>),
?XC(<<"td">>, (pretty_string_int(S2SServers)))])])])];
[?XCT(<<"td">>, <<"Incoming s2s Connections:">>),
?XC(<<"td">>, (pretty_string_int(InS2SNumber)))])])])];
get_stats(Host, Lang) ->
OnlineUsers =
length(ejabberd_sm:get_vh_session_list(Host)),