diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-10-23 14:52:12 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-10-23 14:52:12 +0100 |
commit | d9599e164adcd19f44e4a9188126d671c93c43cf (patch) | |
tree | 53ce25ad9356217426ba520c2d483d5b64d16197 /src/libserver/maps | |
parent | 84603e8f3197652b18d5bc4ca20f5580ce33d6af (diff) | |
download | rspamd-d9599e164adcd19f44e4a9188126d671c93c43cf.tar.gz rspamd-d9599e164adcd19f44e4a9188126d671c93c43cf.zip |
[Minor] Improve map loading logging
Diffstat (limited to 'src/libserver/maps')
-rw-r--r-- | src/libserver/maps/map_helpers.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libserver/maps/map_helpers.c b/src/libserver/maps/map_helpers.c index 02dae0bea..c1ae1b41a 100644 --- a/src/libserver/maps/map_helpers.c +++ b/src/libserver/maps/map_helpers.c @@ -842,7 +842,8 @@ rspamd_kv_list_fin (struct map_cb_data *data, void **target) if (data->cur_data) { htb = (struct rspamd_hash_map_helper *)data->cur_data; - msg_info_map ("read hash of %d elements", kh_size (htb->htb)); + msg_info_map ("read hash of %d elements from %s", kh_size (htb->htb), + map->name); data->map->traverse_function = rspamd_map_helper_traverse_hash; data->map->nelts = kh_size (htb->htb); data->map->digest = rspamd_cryptobox_fast_hash_final (&htb->hst); @@ -1006,6 +1007,8 @@ rspamd_re_map_finalize (struct rspamd_regexp_map_helper *re_map) } if (re_map->regexps->len > 0 && re_map->patterns) { + gdouble ts1 = rspamd_get_ticks (FALSE); + if (hs_compile_multi ((const gchar **)re_map->patterns, re_map->flags, re_map->ids, @@ -1030,6 +1033,10 @@ rspamd_re_map_finalize (struct rspamd_regexp_map_helper *re_map) hs_free_database (re_map->hs_db); re_map->hs_db = NULL; } + + ts1 = (rspamd_get_ticks (FALSE) - ts1) * 1000.0; + msg_info_map ("hyperscan compiled %d regular expressions from %s in %.1f ms", + re_map->regexps->len, re_map->map->name, ts1); } else { msg_err_map ("regexp map is empty"); |