aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-05-17 11:13:40 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-05-17 11:13:57 +0100
commitd024ad57a5738bd05b16436ab740a428e453c47d (patch)
tree27f289bc1afcd2e022f37c667162b23f5d8a8697 /src
parente37ada510298ecfa872f8bdc3138acc85e5ef29c (diff)
downloadrspamd-d024ad57a5738bd05b16436ab740a428e453c47d.tar.gz
rspamd-d024ad57a5738bd05b16436ab740a428e453c47d.zip
[Fix] Try to fix frequency counters
Diffstat (limited to 'src')
-rw-r--r--src/libserver/symbols_cache.c10
1 files 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)) {