diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-08-19 17:47:07 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-08-19 17:47:07 +0100 |
commit | 256a3e0a2967893ba3106fd99f64d16e5b7d21e9 (patch) | |
tree | 10ccd5c0b70f17018d23ceda1392c6ebbdc3b0cb /src/libserver/rspamd_symcache.h | |
parent | f8c8e994b960e6ccd910481c19f56d4ee887a049 (diff) | |
download | rspamd-256a3e0a2967893ba3106fd99f64d16e5b7d21e9.tar.gz rspamd-256a3e0a2967893ba3106fd99f64d16e5b7d21e9.zip |
[Minor] Implement C API to obtain timeouts information
Diffstat (limited to 'src/libserver/rspamd_symcache.h')
-rw-r--r-- | src/libserver/rspamd_symcache.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libserver/rspamd_symcache.h b/src/libserver/rspamd_symcache.h index ee3f4862a..597245ca7 100644 --- a/src/libserver/rspamd_symcache.h +++ b/src/libserver/rspamd_symcache.h @@ -542,6 +542,30 @@ const struct rspamd_symcache_item_stat * */ void rspamd_symcache_enable_profile (struct rspamd_task *task); +struct rspamd_symcache_timeout_item { + double timeout; + const struct rspamd_symcache_item *item; +}; + +struct rspamd_symcache_timeout_result { + double max_timeout; + struct rspamd_symcache_timeout_item *items; + size_t nitems; +}; +/** + * Gets maximum timeout announced by symbols cache + * @param cache + * @return new symcache timeout_result structure, that should be freed by call + * `rspamd_symcache_timeout_result_free` + */ +struct rspamd_symcache_timeout_result* rspamd_symcache_get_max_timeout(struct rspamd_symcache *cache); + +/** + * Frees results obtained from the previous function + * @param res + */ +void rspamd_symcache_timeout_result_free(struct rspamd_symcache_timeout_result *res); + /** * Destroy internal state of the symcache runtime * @param task |