aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/symbols_cache.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-24 16:30:56 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-24 16:30:56 +0000
commitfa869e05c9b06556e90ed29048f596fc0ad9af29 (patch)
tree256363b87c0211e383d80fa2ffbb9871f065e4a8 /src/libserver/symbols_cache.c
parentc1bbc154f83c0e77cd427cf52fa83936266577cc (diff)
downloadrspamd-fa869e05c9b06556e90ed29048f596fc0ad9af29.tar.gz
rspamd-fa869e05c9b06556e90ed29048f596fc0ad9af29.zip
[Minor] More fixes to counters calculations
Diffstat (limited to 'src/libserver/symbols_cache.c')
-rw-r--r--src/libserver/symbols_cache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c
index a541a8656..a772f79d2 100644
--- a/src/libserver/symbols_cache.c
+++ b/src/libserver/symbols_cache.c
@@ -1255,12 +1255,12 @@ rspamd_symbols_cache_check_symbol (struct rspamd_task *task,
}
if (check) {
- t1 = rspamd_get_ticks ();
pending_before = rspamd_session_events_pending (task->s);
/* Watch for events appeared */
rspamd_session_watch_start (task->s, rspamd_symbols_cache_watcher_cb,
item);
msg_debug_task ("execute %s, %d", item->symbol, item->id);
+ t1 = rspamd_get_ticks ();
item->func (task, item->user_data);
t2 = rspamd_get_ticks ();
diff = (t2 - t1) * 1e6;
@@ -1908,10 +1908,11 @@ rspamd_symbols_cache_resort_cb (gint fd, short what, gpointer ud)
if (item->cd->number > 0) {
if (item->type & (SYMBOL_TYPE_CALLBACK|SYMBOL_TYPE_NORMAL)) {
+ item->st->avg_time = item->cd->mean;
rspamd_set_counter (&item->st->time_counter,
item->st->avg_time);
- memset (item->cd, 0, sizeof (*item->cd));
item->st->avg_time = item->st->time_counter.mean;
+ memset (item->cd, 0, sizeof (*item->cd));
}
}
}