mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 13:47:41 +03:00
mod_c2s, mod_s2s: Bootstrap connection count statistic on module load
This commit is contained in:
parent
22ce4d1825
commit
ddccdcd00d
2 changed files with 20 additions and 0 deletions
|
@ -36,6 +36,16 @@ local hosts = prosody.hosts;
|
||||||
local stream_callbacks = { default_ns = "jabber:client" };
|
local stream_callbacks = { default_ns = "jabber:client" };
|
||||||
local listener = {};
|
local listener = {};
|
||||||
|
|
||||||
|
do
|
||||||
|
-- Connection counter resets to 0 on load and reload
|
||||||
|
-- Bump it up to current value
|
||||||
|
local count = 0;
|
||||||
|
for _ in pairs(sessions) do
|
||||||
|
count = count + 1;
|
||||||
|
end
|
||||||
|
measure_connections(count);
|
||||||
|
end
|
||||||
|
|
||||||
--- Stream events handlers
|
--- Stream events handlers
|
||||||
local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'};
|
local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'};
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,16 @@ local sessions = module:shared("sessions");
|
||||||
|
|
||||||
local log = module._log;
|
local log = module._log;
|
||||||
|
|
||||||
|
do
|
||||||
|
-- Connection counter resets to 0 on load and reload
|
||||||
|
-- Bump it up to current value
|
||||||
|
local count = 0;
|
||||||
|
for _ in pairs(sessions) do
|
||||||
|
count = count + 1;
|
||||||
|
end
|
||||||
|
measure_connections(count);
|
||||||
|
end
|
||||||
|
|
||||||
--- Handle stanzas to remote domains
|
--- Handle stanzas to remote domains
|
||||||
|
|
||||||
local bouncy_stanzas = { message = true, presence = true, iq = true };
|
local bouncy_stanzas = { message = true, presence = true, iq = true };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue