guint64 cksum;
gdouble total_weight;
guint used_items;
+ guint stats_symbols_count;
guint64 total_hits;
struct rspamd_config *cfg;
rspamd_mempool_mutex_t *mtx;
cache->cksum = t1ha (&item->id, sizeof (item->id),
cache->cksum);
}
+
+ cache->stats_symbols_count ++;
}
if (name != NULL) {
}
guint
-rspamd_symbols_cache_symbols_count (struct symbols_cache *cache)
+rspamd_symbols_cache_stats_symbols_count (struct symbols_cache *cache)
{
g_assert (cache != NULL);
- return cache->items_by_id->len;
+ return cache->stats_symbols_count;
}
static void
* @param cache
* @return number of symbols in the cache
*/
-guint rspamd_symbols_cache_symbols_count (struct symbols_cache *cache);
+guint rspamd_symbols_cache_stats_symbols_count (struct symbols_cache *cache);
/**
* Call function for cached symbol using saved callback
guint res = 0;
if (cfg != NULL) {
- res = rspamd_symbols_cache_symbols_count (cfg->cache);
+ res = rspamd_symbols_cache_stats_symbols_count (cfg->cache);
}
else {
return luaL_error (L, "invalid arguments");
cbd.normalize = TRUE;
}
- lua_createtable (L, rspamd_symbols_cache_symbols_count (task->cfg->cache), 0);
+ lua_createtable (L,
+ rspamd_symbols_cache_stats_symbols_count (task->cfg->cache), 0);
rspamd_symbols_cache_foreach (task->cfg->cache, tokens_foreach_cb, &cbd);
return 1;