]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Show some target change statistics in /stats t.
authorJilles Tjoelker <redacted>
Sun, 2 Mar 2008 16:03:56 +0000 (17:03 +0100)
committerJilles Tjoelker <redacted>
Sun, 2 Mar 2008 16:03:56 +0000 (17:03 +0100)
- the number of messages blocked by target change on
  this server since it was started
- the number of IPs currently subject to a a lower
  target limit on this server (these expire over time)

include/s_stats.h
modules/core/m_message.c
src/s_stats.c

index 1fe7afa68a9d0b2e4dd93663074486fb4efea216..562e77c6ca87d0c672d3f6b9cb59409dbb1c924d 100644 (file)
@@ -71,6 +71,7 @@ struct ServerStatistics
        unsigned int is_rej;    /* rejected from cache */
        unsigned int is_ssuc;   /* successful sasl authentications */
        unsigned int is_sbad;   /* failed sasl authentications */
+       unsigned int is_tgch;   /* messages blocked due to target change */
 };
 
 extern struct ServerStatistics *ServerStats;
index 5ec761e89dc58804344f89f57bb4ec24b04a48a8..21c93af4923ddfc7ec4e068d006602307df000c7 100644 (file)
@@ -44,6 +44,7 @@
 #include "event.h"
 #include "patricia.h"
 #include "s_newconf.h"
+#include "s_stats.h"
 
 static int m_message(int, const char *, struct Client *, struct Client *, int, const char **);
 static int m_privmsg(struct Client *, struct Client *, int, const char **);
@@ -609,6 +610,7 @@ add_target(struct Client *source_p, struct Client *target_p)
                /* cant clear any, full target list */
                else if(USED_TARGETS(source_p) == 10)
                {
+                       ServerStats->is_tgch++;
                        add_tgchange(source_p->sockhost);
                        return 0;
                }
index 8efde154f1055f909242f617cb093cfea862e9ae..e998ce489d7ff24a3c16bfcf04b65d18da7b26be 100644 (file)
@@ -139,6 +139,9 @@ tstats(struct Client *source_p)
                           sp->is_wrdi, sp->is_empt);
        sendto_one_numeric(source_p, RPL_STATSDEBUG,
                           "T :numerics seen %u", sp->is_num);
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,
+                          "T :tgchange blocked msgs %u restricted addrs %u",
+                          sp->is_tgch, dlink_list_length(&tgchange_list));
        sendto_one_numeric(source_p, RPL_STATSDEBUG,
                           "T :auth successes %u fails %u",
                           sp->is_asuc, sp->is_abad);