mod_statsd/mod_statsd.lua
changeset 1449 d31ace5b1175
parent 1447 365f6db9531a
child 2429 26c68a5f432f
equal deleted inserted replaced
1448:5107278268ae 1449: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)