]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] Use proper rounding for symbol frequency statistics 5840/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Wed, 14 Jan 2026 16:11:50 +0000 (19:11 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Wed, 14 Jan 2026 17:09:05 +0000 (20:09 +0300)
commite41ff73cdd90b7cf54c7ae962272c0933898a299
treea2142aeb45e06a88dec56b762cfb7a7d5805c6de
parent2294e30c3f51593b5a2c3a8580523727e4297b17
[Fix] Use proper rounding for symbol frequency statistics

- Replace incorrect floor() with round() in rounding functions to avoid
  losing small values
- Increase counters API frequency precision from 3 to 6 decimal places
  (need 5 to avoid rspamc displaying values as multiples of 0.06, need 6
  for /counters endpoint itself - no additional overhead as JSON stores
  double anyway)
- Add frequency_stddev field to counters API output (fixes zero stdev in
  `rspamc counters` output)
- Clarify `rspamc counters` table header with "avg (stddev)" subheading
- Fix WebUI to preserve frequency precision before scaling

Example for symbol with frequency 0.004772 hits/sec:
- Before: /symbols returns 0.004772, /counters returns 0.004000,
  `rspamc counters` shows 0.240
- After:  /symbols returns 0.004772, /counters returns 0.004772,
  `rspamc counters` shows 0.286
interface/js/app/symbols.js
src/client/rspamc.cxx
src/libserver/symcache/symcache_impl.cxx