From d024ad57a5738bd05b16436ab740a428e453c47d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 17 May 2018 11:13:40 +0100 Subject: [PATCH] [Fix] Try to fix frequency counters --- src/libserver/symbols_cache.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index ecc569573..66ae1c1b9 100644 --- a/src/libserver/symbols_cache.c +++ b/src/libserver/symbols_cache.c @@ -1270,7 +1270,7 @@ rspamd_symbols_cache_check_symbol (struct rspamd_task *task, struct rspamd_task **ptask; lua_State *L; gboolean check = TRUE; - const gdouble slow_diff_limit = 1e7; + const gdouble slow_diff_limit = 0.1; if (item->func) { @@ -1309,9 +1309,9 @@ rspamd_symbols_cache_check_symbol (struct rspamd_task *task, rspamd_symbols_cache_watcher_cb, item); msg_debug_task ("execute %s, %d", item->symbol, item->id); - t1 = rspamd_get_ticks (TRUE); + t1 = rspamd_get_ticks (FALSE); item->func (task, item->user_data); - t2 = rspamd_get_ticks (TRUE); + t2 = rspamd_get_ticks (FALSE); diff = (t2 - t1); if (G_UNLIKELY (RSPAMD_TASK_IS_PROFILING (task))) { @@ -1323,8 +1323,8 @@ rspamd_symbols_cache_check_symbol (struct rspamd_task *task, } if (diff > slow_diff_limit && !(item->type & SYMBOL_TYPE_SQUEEZED)) { - msg_info_task ("slow rule: %s: %.0f ticks", item->symbol, - diff); + msg_info_task ("slow rule: %s: %.2f ms", item->symbol, + diff * 1000); } if (rspamd_worker_is_scanner (task->worker)) { -- 2.39.5