From cff3d8b50076fc8d189f97a6ba70064884141237 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Mon, 25 Sep 2023 18:42:04 +0800 Subject: 增加是否开启HIT_GROUP和HIT_PATH的开关,默认关闭 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_rule.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/tsg_rule.cpp') diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp index 4f1068d..ffb5a1f 100644 --- a/src/tsg_rule.cpp +++ b/src/tsg_rule.cpp @@ -1861,6 +1861,8 @@ int init_plugin_table(struct maat *feather, const char *conffile) struct maat *init_maat_feather(const char* conffile, char* instance_name, char *module) { + int hit_path=0; + int hit_group=0; int deferred_load=0; char maat_mode[32]={0}; int effect_interval_ms=60000; @@ -1904,8 +1906,10 @@ struct maat *init_maat_feather(const char* conffile, char* instance_name, char * char log_path[128]={0}; MESA_load_profile_string_def(conffile,module,"LOG_PATH", log_path, sizeof(log_path), "./log/maat.log"); - MESA_load_profile_int_def(conffile, module,"STAT_SWITCH", &(maat_stat_on),1); - MESA_load_profile_int_def(conffile, module,"PERF_SWITCH", &(maat_perf_on),1); + MESA_load_profile_int_def(conffile, module,"STAT_SWITCH", &(maat_stat_on), 1); + MESA_load_profile_int_def(conffile, module,"PERF_SWITCH", &(maat_perf_on), 1); + MESA_load_profile_int_def(conffile, module,"HIT_PATH_SWITCH", &(hit_path), 0); + MESA_load_profile_int_def(conffile, module,"HIT_GROUP_SWITCH", &(hit_group), 0); MESA_load_profile_int_def(conffile, module,"OUTPUT_PROMETHEUS", &(output_prometheus), 1); MESA_load_profile_int_def(conffile, module,"DEFERRED_LOAD", &(deferred_load), 0); MESA_load_profile_string_def(conffile,module,"TABLE_INFO",table_info, sizeof(table_info), ""); @@ -1926,6 +1930,16 @@ struct maat *init_maat_feather(const char* conffile, char* instance_name, char * maat_options_set_rule_update_checking_interval_ms(opts, rule_update_interval_ms); maat_options_set_gc_timeout_ms(opts, garbage_collect_ms); + if(hit_group) + { + maat_options_set_hit_group_enabled(opts); + } + + if(hit_path) + { + maat_options_set_hit_path_enabled(opts); + } + if(maat_stat_on==1) { maat_options_set_stat_on(opts); -- cgit v1.2.3