# HG changeset patch # User daurnimator # Date 1403554006 14400 # Node ID 365f6db9531ac74f9e231feeb99d138459d29625 # Parent d722a4defea7da2a418c2eca12ebe644437e3415 mod_statsd: Better accounting for invites, add declines diff -r d722a4defea7 -r 365f6db9531a mod_statsd/mod_statsd.lua --- a/mod_statsd/mod_statsd.lua Mon Jun 23 16:05:54 2014 -0400 +++ b/mod_statsd/mod_statsd.lua Mon Jun 23 16:06:46 2014 -0400 @@ -56,9 +56,20 @@ send(prefix..clean(room_node)..".broadcast-message:1|c") end) module:hook("muc-invite", function(event) + -- Total count send(prefix.."invite:1|c") local room_node = jid.split(event.room.jid) + -- Counts per room send(prefix..clean(room_node)..".invite:1|c") - local to_node, to_host, to_resource = jid.split(event.stanza.attr.to) - send(prefix..clean(to_node)..".invites:1|c") + -- Counts per recipient + send(prefix..clean(event.stanza.attr.to)..".invited:1|c") end) +module:hook("muc-decline", function(event) + -- Total count + send(prefix.."decline:1|c") + local room_node = jid.split(event.room.jid) + -- Counts per room + send(prefix..clean(room_node)..".decline:1|c") + -- Counts per sender + send(prefix..clean(event.incoming.attr.from)..".declined:1|c") +end)