diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-14 19:38:48 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-14 19:38:48 +0100 |
commit | acaf4fe66e6b09938437ab992c015da1a9ac9eaf (patch) | |
tree | c91910d74e5fc421ddb054d03c86be906ddcb6de /src/libutil/expression.h | |
parent | 0b7a4e77fe205edf95e020471d222eb64c05e502 (diff) | |
download | rspamd-acaf4fe66e6b09938437ab992c015da1a9ac9eaf.tar.gz rspamd-acaf4fe66e6b09938437ab992c015da1a9ac9eaf.zip |
[Minor] Use ema functions to calculate average ticks for expressions
Diffstat (limited to 'src/libutil/expression.h')
-rw-r--r-- | src/libutil/expression.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libutil/expression.h b/src/libutil/expression.h index 9976b7fcd..1c8665ade 100644 --- a/src/libutil/expression.h +++ b/src/libutil/expression.h @@ -19,6 +19,7 @@ #include "config.h" #include "mem_pool.h" #include "fstring.h" +#include "util.h" #ifdef __cplusplus extern "C" { @@ -55,13 +56,11 @@ typedef struct rspamd_expression_atom_s { /* String representation of atom */ const gchar *str; /* Length of the string representation of atom */ - gsize len; - /* Average execution time (in ticks) */ - gdouble avg_ticks; - /* Amount of positive triggers */ - guint hits; + guint len; /* Relative priority */ gint priority; + guint hits; + struct rspamd_counter_data exec_time; } rspamd_expression_atom_t; typedef gdouble (*rspamd_expression_process_cb) (gpointer runtime_data, |