summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorliuxueli <[email protected]>2023-09-25 18:42:04 +0800
committerliuxueli <[email protected]>2023-09-25 18:42:04 +0800
commitcff3d8b50076fc8d189f97a6ba70064884141237 (patch)
treec683b990ee7df1de455074d6c1e6ef8f6d5dff6d /src
parent7905a5277acd8c0ebe133e0ec643c1887413d364 (diff)
增加是否开启HIT_GROUP和HIT_PATH的开关,默认关闭
Diffstat (limited to 'src')
-rw-r--r--src/tsg_rule.cpp18
1 files changed, 16 insertions, 2 deletions
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);