#endif
static int command_print_stats(rad_listen_t *listener, fr_stats_t *stats,
- int auth)
+ int auth, int server)
{
int i;
cprintf(listener, "\tdropped\t\t" PU "\n", stats->total_packets_dropped);
cprintf(listener, "\tunknown_types\t" PU "\n", stats->total_unknown_types);
+ if (server) {
+ cprintf(listener, "\ttimeouts\t" PU "\n", stats->total_timeouts);
+ }
+
cprintf(listener, "\tlast_packet\t%lu\n", stats->last_packet);
for (i = 0; i < 8; i++) {
cprintf(listener, "\telapsed.%s\t%u\n",
#ifdef WITH_ACCOUNTING
if (strcmp(argv[0], "acct") == 0) {
return command_print_stats(listener,
- &proxy_acct_stats, 0);
+ &proxy_acct_stats, 0, 1);
}
#endif
if (strcmp(argv[0], "auth") == 0) {
return command_print_stats(listener,
- &proxy_auth_stats, 1);
+ &proxy_auth_stats, 1, 1);
}
cprintf(listener, "ERROR: Should specify [auth/acct]\n");
}
command_print_stats(listener, &home->stats,
- (home->type == HOME_TYPE_AUTH));
+ (home->type == HOME_TYPE_AUTH), 1);
cprintf(listener, "\toutstanding\t%d\n", home->currently_outstanding);
return 1;
}
#ifdef WITH_ACCOUNTING
if (!auth) {
return command_print_stats(listener,
- &radius_acct_stats, auth);
+ &radius_acct_stats, auth, 0);
}
#endif
- return command_print_stats(listener, &radius_auth_stats, auth);
+ return command_print_stats(listener, &radius_auth_stats, auth, 0);
}
- return command_print_stats(listener, stats, auth);
+ return command_print_stats(listener, stats, auth, 0);
}
if (sock->type != RAD_LISTEN_AUTH) auth = FALSE;
- return command_print_stats(listener, &sock->stats, auth);
+ return command_print_stats(listener, &sock->stats, auth, 0);
}
#endif /* WITH_STATS */
return;
}
+ FR_STATS_TYPE_INC(home->stats.total_timeouts);
+ if (home->type == HOME_TYPE_AUTH) {
+ FR_STATS_TYPE_INC(request->proxy_listener->stats.total_timeouts);
+ FR_STATS_TYPE_INC(proxy_auth_stats.total_timeouts);
+ }
+#ifdef WITH_ACCT
+ else if (home->rtype == HOME_TYPE_ACCT) {
+ FR_STATS_TYPE_INC(request->proxy_listener->stats.total_timeouts);
+ FR_STATS_TYPE_INC(proxy_acct_stats.total_timeouts);
+ }
+#endif
+
/*
* FIXME: debug log no response to proxied request
*/
static struct timeval start_time;
static struct timeval hup_time;
-#define FR_STATS_INIT { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+#define FR_STATS_INIT { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
{ 0, 0, 0, 0, 0, 0, 0, 0 }}
fr_stats_t radius_auth_stats = FR_STATS_INIT;