From 24797bfa22dbfcab2ad085a2a0e9943dd932db25 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 12 May 2018 19:43:57 -0700 Subject: [PATCH] ircd::m::hook: Add call counter. --- include/ircd/m/hook.h | 1 + ircd/m/m.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/include/ircd/m/hook.h b/include/ircd/m/hook.h index a83fb6f35..e67102e70 100644 --- a/include/ircd/m/hook.h +++ b/include/ircd/m/hook.h @@ -28,6 +28,7 @@ struct ircd::m::hook m::event matching; std::function function; bool registered {false}; + size_t calls {0}; string_view site_name() const; site *find_site() const; diff --git a/ircd/m/m.cc b/ircd/m/m.cc index bb48e4061..a1dcdcd82 100644 --- a/ircd/m/m.cc +++ b/ircd/m/m.cc @@ -3137,6 +3137,7 @@ ircd::m::hook::site::call(hook &hook, const event &event) try { + ++hook.calls; hook.function(event); } catch(const std::exception &e)