add rule count stat

This commit is contained in:
liuwentan
2023-04-12 19:20:05 +08:00
parent e8fb0143e9
commit f213fcbe97
26 changed files with 246 additions and 68 deletions

View File

@@ -34,9 +34,7 @@ struct bool_plugin_schema {
struct bool_plugin_runtime {
struct bool_matcher *matcher;
struct ex_data_runtime *ex_data_rt;
uint32_t rule_num;
long long rule_num;
struct maat_garbage_bin *ref_garbage_bin;
struct log_handle *logger;
};
@@ -477,6 +475,16 @@ int bool_plugin_runtime_commit(void *bool_plugin_runtime, const char *table_name
return ret;
}
long long bool_plugin_runtime_rule_count(void *bool_plugin_runtime)
{
if (NULL == bool_plugin_runtime) {
return 0;
}
struct bool_plugin_runtime *bool_plugin_rt = (struct bool_plugin_runtime *)bool_plugin_runtime;
return bool_plugin_rt->rule_num;
}
struct ex_data_runtime *bool_plugin_runtime_get_ex_data_rt(void *bool_plugin_runtime)
{
if (NULL == bool_plugin_runtime) {