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

@@ -71,7 +71,7 @@ struct expr_runtime {
struct rcu_hash_table *htable; // store hs_expr rule for rebuild adapter_hs instance
struct rcu_hash_table *item_htable; // store this expr table's all maat_item which will be used in expr_runtime_scan
uint32_t rule_num;
long long rule_num;
int n_worker_thread;
struct maat_garbage_bin *ref_garbage_bin;
struct log_handle *logger;
@@ -874,6 +874,16 @@ int expr_runtime_commit(void *expr_runtime, const char *table_name)
return ret;
}
long long expr_runtime_rule_count(void *expr_runtime)
{
if (NULL == expr_runtime) {
return 0;
}
struct expr_runtime *expr_rt = (struct expr_runtime *)expr_runtime;
return expr_rt->rule_num;
}
int expr_runtime_scan(struct expr_runtime *expr_rt, int thread_id, const char *data,
size_t data_len, int vtable_id, struct maat_state *state)
{