comparison mod_statsd/mod_statsd.lua @ 1451:d31ace5b1175

mod_statsd: Add missing `pairs` call
author daurnimator <quae@daurnimator.com>
date Tue, 24 Jun 2014 12:16:44 -0400
parents 365f6db9531a
children 26c68a5f432f
comparison
equal deleted inserted replaced
1450:5107278268ae 1451:d31ace5b1175
27 end 27 end
28 28
29 -- Track users as they bind/unbind 29 -- Track users as they bind/unbind
30 -- count bare sessions every time, as we have no way to tell if it's a new bare session or not 30 -- count bare sessions every time, as we have no way to tell if it's a new bare session or not
31 module:hook("resource-bind", function(event) 31 module:hook("resource-bind", function(event)
32 send(prefix.."bare_sessions:"..iterators.count(bare_sessions).."|g") 32 send(prefix.."bare_sessions:"..iterators.count(pairs(bare_sessions)).."|g")
33 send(prefix.."full_sessions:+1|g") 33 send(prefix.."full_sessions:+1|g")
34 end, 1) 34 end, 1)
35 module:hook("resource-unbind", function(event) 35 module:hook("resource-unbind", function(event)
36 send(prefix.."bare_sessions:"..iterators.count(bare_sessions).."|g") 36 send(prefix.."bare_sessions:"..iterators.count(pairs(bare_sessions)).."|g")
37 send(prefix.."full_sessions:-1|g") 37 send(prefix.."full_sessions:-1|g")
38 end, 1) 38 end, 1)
39 39
40 -- Track MUC occupants as they join/leave 40 -- Track MUC occupants as they join/leave
41 module:hook("muc-occupant-joined", function(event) 41 module:hook("muc-occupant-joined", function(event)