diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-01-28 11:39:48 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-01-28 11:39:48 +0000 |
commit | 98170e8b0b5573b1049650193817a7f3ee6f1bd6 (patch) | |
tree | cdaccb286846a981161e75a668897cfed173e03f | |
parent | c5956e2dce02f6089d1fb7c8415f5eb785928daf (diff) | |
download | rspamd-98170e8b0b5573b1049650193817a7f3ee6f1bd6.tar.gz rspamd-98170e8b0b5573b1049650193817a7f3ee6f1bd6.zip |
[Minor] Print ticks in language detection debug mode
-rw-r--r-- | src/libmime/lang_detection.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libmime/lang_detection.c b/src/libmime/lang_detection.c index 4c1f55d31..b3188e6dd 100644 --- a/src/libmime/lang_detection.c +++ b/src/libmime/lang_detection.c @@ -973,7 +973,7 @@ struct rspamd_frequency_sort_cbdata { }; static const gdouble tier1_adjustment = 0.8; -static const gdouble frequency_adjustment = 0.4; +static const gdouble frequency_adjustment = 0.8; static gint rspamd_language_detector_cmp_heuristic (gconstpointer a, gconstpointer b, @@ -1040,7 +1040,7 @@ rspamd_language_detector_detect (struct rspamd_task *task, GPtrArray *result; GHashTableIter it; gpointer k, v; - gdouble mean, std; + gdouble mean, std, start_ticks, end_ticks; struct rspamd_lang_detector_res *cand; enum rspamd_language_detected_type r; struct rspamd_frequency_sort_cbdata cbd; @@ -1051,6 +1051,7 @@ rspamd_language_detector_detect (struct rspamd_task *task, return g_ptr_array_new (); } + start_ticks = rspamd_get_ticks (TRUE); candidates = g_hash_table_new_full (rspamd_str_hash, rspamd_str_equal, NULL, g_free); @@ -1130,5 +1131,9 @@ rspamd_language_detector_detect (struct rspamd_task *task, d->total_occurencies ++; } + end_ticks = rspamd_get_ticks (TRUE); + msg_debug_lang_det ("detected languages in %.0f ticks", + (end_ticks - start_ticks)); + return result; }
\ No newline at end of file |