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

@@ -43,7 +43,7 @@ struct interval_runtime {
struct interval_matcher *matcher;
struct rcu_hash_table *htable; //store interval rule for rebuild interval_matcher instance
struct rcu_hash_table *item_htable; //store this interval table's all maat_item which will be used in interval_runtime_scan
uint32_t rule_num;
long long rule_num;
struct maat_garbage_bin *ref_garbage_bin;
struct log_handle *logger;
int district_num;
@@ -518,6 +518,16 @@ int interval_runtime_commit(void *interval_runtime, const char *table_name)
return ret;
}
long long interval_runtime_rule_count(void *interval_runtime)
{
if (NULL == interval_runtime) {
return 0;
}
struct interval_runtime *interval_rt = (struct interval_runtime *)interval_runtime;
return interval_rt->rule_num;
}
int interval_runtime_scan(struct interval_runtime *interval_rt, int thread_id,
long long integer, int vtable_id, struct maat_state *state)
{