aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_c2s.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
commita18479bd7009a6b522ee8227d56dbb10165986dc (patch)
tree31761c9353aa037ad5eff226290f1c2badf52875 /plugins/mod_c2s.lua
parent2ba75409abf346221a10956cbc97da540de64deb (diff)
downloadprosody-a18479bd7009a6b522ee8227d56dbb10165986dc.tar.gz
prosody-a18479bd7009a6b522ee8227d56dbb10165986dc.zip
mod_c2s, mod_s2s: Bootstrap connection count statistic on module load
Diffstat (limited to 'plugins/mod_c2s.lua')
-rw-r--r--plugins/mod_c2s.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index 2829d5fd..e69bf461 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -36,6 +36,16 @@ local hosts = prosody.hosts;
local stream_callbacks = { default_ns = "jabber:client" };
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
local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'};