RSPAMD_LOG_SETTINGS_ID,
RSPAMD_LOG_GROUPS,
RSPAMD_LOG_PUBLIC_GROUPS,
+ RSPAMD_LOG_MEMPOOL_SIZE,
+ RSPAMD_LOG_MEMPOOL_WASTE,
};
enum rspamd_log_format_flags {
else if (rspamd_ftok_cstr_equal (&tok, "settings_id", TRUE)) {
type = RSPAMD_LOG_SETTINGS_ID;
}
+ else if (rspamd_ftok_cstr_equal (&tok, "mempool_size", TRUE)) {
+ type = RSPAMD_LOG_MEMPOOL_SIZE;
+ }
+ else if (rspamd_ftok_cstr_equal (&tok, "mempool_waste", TRUE)) {
+ type = RSPAMD_LOG_MEMPOOL_WASTE;
+ }
else {
msg_err_config ("unknown log variable: %T", &tok);
return FALSE;
var.len = sizeof (undef) - 1;
}
break;
+ case RSPAMD_LOG_MEMPOOL_SIZE:
+ var.len = rspamd_snprintf (numbuf, sizeof (numbuf),
+ "%Hz",
+ task->task_pool->used_memory);
+ var.begin = numbuf;
+ break;
+ case RSPAMD_LOG_MEMPOOL_WASTE:
+ var.len = rspamd_snprintf (numbuf, sizeof (numbuf),
+ "%Hz",
+ task->task_pool->wasted_memory);
+ var.begin = numbuf;
+ break;
default:
var = rspamd_task_log_metric_res (task, lf);
break;