commit fc2e805: [Minor] Save in stats

Vsevolod Stakhov vsevolod at rspamd.com
Sat Jan 14 13:07:03 UTC 2023


Author: Vsevolod Stakhov
Date: 2023-01-14 13:00:14 +0000
URL: https://github.com/rspamd/rspamd/commit/fc2e8055d2afa1d09dcbc42616581b84ca4f74e9 (HEAD -> master)

[Minor] Save in stats

---
 src/fuzzy_storage.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 874e81c87..99a5a3bed 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -1873,15 +1873,19 @@ rspamd_fuzzy_storage_stat_key (struct fuzzy_key_stat *key_stat)
 	res = ucl_object_typed_new (UCL_OBJECT);
 
 	ucl_object_insert_key (res, ucl_object_fromint (key_stat->checked),
-			"checked", 0, false);
+		"checked", 0, false);
+	ucl_object_insert_key (res, ucl_object_fromdouble(key_stat->checked_ctr.mean),
+		"checked_per_hour", 0, false);
 	ucl_object_insert_key (res, ucl_object_fromint (key_stat->matched),
-			"matched", 0, false);
+		"matched", 0, false);
+	ucl_object_insert_key (res, ucl_object_fromdouble(key_stat->checked_ctr.mean),
+		"matched_per_hour", 0, false);
 	ucl_object_insert_key (res, ucl_object_fromint (key_stat->added),
-			"added", 0, false);
+		"added", 0, false);
 	ucl_object_insert_key (res, ucl_object_fromint (key_stat->deleted),
-			"deleted", 0, false);
+		"deleted", 0, false);
 	ucl_object_insert_key (res, ucl_object_fromint (key_stat->errors),
-			"errors", 0, false);
+		"errors", 0, false);
 
 	return res;
 }


More information about the Commits mailing list