Changeset

3951:32d9d155a9b9

mod_measure_registration: new module
author Maxime “pep” Buquet <pep@bouah.net>
date Sat, 21 Mar 2020 15:03:47 +0100
parents 3950:e9e41e75c5a0
children 3952:343dc9dd70dd
files mod_measure_registration/README.markdown mod_measure_registration/mod_measure_registration.lua
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mod_measure_registration/README.markdown	Sat Mar 21 15:03:47 2020 +0100
@@ -0,0 +1,11 @@
+---
+labels:
+- Statistics
+summary: Collect statistics on user registration
+---
+
+Description
+===========
+
+This module measures the rate at which users register on the server (through
+providers like `mod_register_ibr` or `mod_register_web`).
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mod_measure_registration/mod_measure_registration.lua	Sat Mar 21 15:03:47 2020 +0100
@@ -0,0 +1,10 @@
+local count_registering = module:measure("user_registering", "rate");
+local count_registered = module:measure("user_registered", "rate");
+
+module:hook("user-registering", function ()
+	count_registering();
+end);
+
+module:hook("user-registered", function ()
+	count_registered();
+end);