aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s/mod_s2s.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-07-07 18:48:58 +0200
committerKim Alvefur <zash@zash.se>2016-07-07 18:48:58 +0200
commitddccdcd00d24514e5a9bafad9d5789f674bd8770 (patch)
tree31761c9353aa037ad5eff226290f1c2badf52875 /plugins/mod_s2s/mod_s2s.lua
parent22ce4d182541dfd2699c0cb85f4f551d254d3ea3 (diff)
downloadprosody-ddccdcd00d24514e5a9bafad9d5789f674bd8770.tar.gz
prosody-ddccdcd00d24514e5a9bafad9d5789f674bd8770.zip
mod_c2s, mod_s2s: Bootstrap connection count statistic on module load
Diffstat (limited to 'plugins/mod_s2s/mod_s2s.lua')
-rw-r--r--plugins/mod_s2s/mod_s2s.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index f05e2a95..ea186cf0 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -43,6 +43,16 @@ local sessions = module:shared("sessions");
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
local bouncy_stanzas = { message = true, presence = true, iq = true };