diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-06-04 21:55:57 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-06-04 21:55:57 +0400 |
commit | f7bb8b73f04fcb3b4b815e956155e4f3df6eb486 (patch) | |
tree | 93054d43bdbe96aadffcd050326f1c72e1a6a6d7 /src | |
parent | 69c17a3e2846a5e5db1183f7c2c618a09aac64a9 (diff) | |
download | rspamd-f7bb8b73f04fcb3b4b815e956155e4f3df6eb486.tar.gz rspamd-f7bb8b73f04fcb3b4b815e956155e4f3df6eb486.zip |
Print percents with actions in controller's 'stat' command output.
Diffstat (limited to 'src')
-rw-r--r-- | src/controller.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/controller.c b/src/controller.c index d11edbfe6..1773fc447 100644 --- a/src/controller.c +++ b/src/controller.c @@ -400,8 +400,9 @@ process_stat_command (struct controller_session *session) r = rspamd_snprintf (out_buf, sizeof (out_buf), "Messages scanned: %ud" CRLF, session->worker->srv->stat->messages_scanned); if (session->worker->srv->stat->messages_scanned > 0) { for (i = METRIC_ACTION_REJECT; i <= METRIC_ACTION_NOACTION; i ++) { - r += rspamd_snprintf (out_buf + r, sizeof (out_buf) - r, "Messages with action %s: %ud" CRLF, - str_action_metric (i), session->worker->srv->stat->actions_stat[i]); + r += rspamd_snprintf (out_buf + r, sizeof (out_buf) - r, "Messages with action %s: %ud, %.2f%%" CRLF, + str_action_metric (i), session->worker->srv->stat->actions_stat[i], + (double)session->worker->srv->stat->actions_stat[i] / (double)session->worker->srv->stat->messages_scanned * 100.); if (i < METRIC_ACTION_GREYLIST) { spam += session->worker->srv->stat->actions_stat[i]; } |