Software /
code /
prosody
Comparison
plugins/mod_s2s/mod_s2s.lua @ 7466:f28fa742def3
mod_c2s, mod_s2s: Bootstrap connection count statistic on module load
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 07 Jul 2016 18:48:58 +0200 |
parent | 7449:6943b1dd4e3d |
child | 7467:9a73c85baffe |
child | 7537:a0813737c6fa |
comparison
equal
deleted
inserted
replaced
7464:3b7de72e58a9 | 7466:f28fa742def3 |
---|---|
40 local measure_connections = module:measure("connections", "counter"); | 40 local measure_connections = module:measure("connections", "counter"); |
41 | 41 |
42 local sessions = module:shared("sessions"); | 42 local sessions = module:shared("sessions"); |
43 | 43 |
44 local log = module._log; | 44 local log = module._log; |
45 | |
46 do | |
47 -- Connection counter resets to 0 on load and reload | |
48 -- Bump it up to current value | |
49 local count = 0; | |
50 for _ in pairs(sessions) do | |
51 count = count + 1; | |
52 end | |
53 measure_connections(count); | |
54 end | |
45 | 55 |
46 --- Handle stanzas to remote domains | 56 --- Handle stanzas to remote domains |
47 | 57 |
48 local bouncy_stanzas = { message = true, presence = true, iq = true }; | 58 local bouncy_stanzas = { message = true, presence = true, iq = true }; |
49 local function bounce_sendq(session, reason) | 59 local function bounce_sendq(session, reason) |