Show some target change statistics in /stats t.

- 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)
This commit is contained in:
Jilles Tjoelker 2008-03-02 17:03:56 +01:00
parent a65f9880f6
commit 43f8445df3
3 changed files with 6 additions and 0 deletions

View 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;

View 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;
}

View 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);