]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Use averages in fuzzystat
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 14 Jan 2023 21:41:43 +0000 (21:41 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 14 Jan 2023 21:41:43 +0000 (21:41 +0000)
lualib/rspamadm/fuzzy_stat.lua

index c3372ca918f2d8e9014c8ba44d39e2365b999efd..3959103a5857748aa68cfb434cbc71f147d93d2a 100644 (file)
@@ -59,10 +59,20 @@ end
 
 local function print_stat(st, tabs)
   if st['checked'] then
-    print(string.format('%sChecked: %s', tabs, print_num(st['checked'])))
+    if st.checked_per_hour then
+      print(string.format('%sChecked: %s (%s per hour in average)', tabs,
+          print_num(st['checked']), print_num(st['checked_per_hour'])))
+    else
+      print(string.format('%sChecked: %s', tabs, print_num(st['checked'])))
+    end
   end
   if st['matched'] then
-    print(string.format('%sMatched: %s', tabs, print_num(st['matched'])))
+    if st.matched_per_hour then
+      print(string.format('%sMatched: %s (%s per hour in average)', tabs,
+          print_num(st['matched']), print_num(st['matched_per_hour'])))
+    else
+      print(string.format('%sMatched: %s', tabs, print_num(st['matched'])))
+    end
   end
   if st['errors'] then
     print(string.format('%sErrors: %s', tabs, print_num(st['errors'])))