summaryrefslogtreecommitdiffstats
path: root/src/client/rspamc.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-27 18:16:11 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-27 18:16:11 +0100
commit79052d53a490c8f1122f15e5e75465c6653d9b1a (patch)
tree7b2785850845a9b68b8cc9b7f34e1472c815fcaa /src/client/rspamc.c
parent37965fd580c62d8b246e33f9d7b4c315c6d1cd06 (diff)
downloadrspamd-79052d53a490c8f1122f15e5e75465c6653d9b1a.tar.gz
rspamd-79052d53a490c8f1122f15e5e75465c6653d9b1a.zip
[Feature] Allow to query storage about number of fuzzy hashes stored
Diffstat (limited to 'src/client/rspamc.c')
-rw-r--r--src/client/rspamc.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/client/rspamc.c b/src/client/rspamc.c
index 68c33472d..6c99f9984 100644
--- a/src/client/rspamc.c
+++ b/src/client/rspamc.c
@@ -910,10 +910,23 @@ rspamc_stat_output (FILE *out, ucl_object_t *obj)
rspamd_printf_gstring (out_str, "Oversized chunks: %L\n",
ucl_object_toint (ucl_object_lookup (obj, "chunks_oversized")));
/* Fuzzy */
- rspamd_printf_gstring (out_str, "Fuzzy hashes stored: %L\n",
- ucl_object_toint (ucl_object_lookup (obj, "fuzzy_stored")));
- rspamd_printf_gstring (out_str, "Fuzzy hashes expired: %L\n",
- ucl_object_toint (ucl_object_lookup (obj, "fuzzy_expired")));
+
+ st = ucl_object_lookup (obj, "fuzzy_hashes");
+ if (st) {
+ ucl_object_iter_t it = NULL;
+ const ucl_object_t *cur;
+ gint64 stored = 0;
+
+ while ((cur = ucl_iterate_object (st, &it, true)) != NULL) {
+ rspamd_printf_gstring (out_str, "Fuzzy hashes in storage \"%s\": %L\n",
+ ucl_object_key (cur),
+ ucl_object_toint (cur));
+ stored += ucl_object_toint (cur);
+ }
+
+ rspamd_printf_gstring (out_str, "Fuzzy hashes stored: %L\n",
+ stored);
+ }
st = ucl_object_lookup (obj, "fuzzy_checked");
if (st != NULL && ucl_object_type (st) == UCL_ARRAY) {