aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/stat_api.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-01-23 12:18:04 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-01-23 12:18:04 +0000
commit8f5509c65dc6907a7581518246a200236088423c (patch)
tree448c0233a83ee25855999033c22d78b2297b64f5 /src/libstat/stat_api.h
parent8969605e58c22b95ac4eb8783b6c4d045732810e (diff)
downloadrspamd-8f5509c65dc6907a7581518246a200236088423c.tar.gz
rspamd-8f5509c65dc6907a7581518246a200236088423c.zip
Rework statistics runtime structures.
Diffstat (limited to 'src/libstat/stat_api.h')
-rw-r--r--src/libstat/stat_api.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/libstat/stat_api.h b/src/libstat/stat_api.h
index 0e2bf86b8..64b3f0b92 100644
--- a/src/libstat/stat_api.h
+++ b/src/libstat/stat_api.h
@@ -31,6 +31,35 @@
* High level statistics API
*/
+struct rspamd_statfile_runtime {
+ struct rspamd_statfile_config *st;
+ guint64 hits;
+ guint64 total_hits;
+};
+
+struct rspamd_classifier_runtime {
+ double ham_prob;
+ double spam_prob;
+ guint64 total_spam;
+ guint64 total_ham;
+ guint64 processed_tokens;
+ gsize max_tokens;
+};
+
+struct rspamd_token_result {
+ double value;
+ struct rspamd_statfile_runtime *st_runtime;
+
+ struct rspamd_classifier_runtime *cl_runtime;
+};
+
+#define RSPAMD_MAX_TOKEN_LEN 64
+typedef struct token_node_s {
+ guchar data[RSPAMD_MAX_TOKEN_LEN];
+ guint datalen;
+ GArray *results;
+} rspamd_token_t;
+
/**
* Initialise statistics modules
* @param cfg