summaryrefslogtreecommitdiff
path: root/src/tsg_rule.cpp
diff options
context:
space:
mode:
author刘学利 <[email protected]>2023-06-05 06:01:33 +0000
committer刘学利 <[email protected]>2023-06-05 06:01:33 +0000
commit4c8eecdb414b6fb2897cd628acb7bbcfc19c1556 (patch)
treebeca74956ae973655b6f410e5340a6f74d1b7dfd /src/tsg_rule.cpp
parent26ccdc1f64c1b8b3a828616b0812a4220f91cd03 (diff)
增加MAAT4的输出统计v6.0.21
Diffstat (limited to 'src/tsg_rule.cpp')
-rw-r--r--src/tsg_rule.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp
index 3b1164b..7fe3784 100644
--- a/src/tsg_rule.cpp
+++ b/src/tsg_rule.cpp
@@ -1893,7 +1893,9 @@ struct maat *init_maat_feather(const char* conffile, char* instance_name, char *
{
int deferred_load=0;
char maat_mode[32]={0};
- int effect_interval=60;
+ int effect_interval_ms=60000;
+ int rule_update_interval_ms=60000;
+ int garbage_collect_ms=30000;
char effective_range_filename[1024]={0};
char effective_flag[1024]={0};
int output_prometheus=0;
@@ -1938,16 +1940,31 @@ struct maat *init_maat_feather(const char* conffile, char* instance_name, char *
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), "");
MESA_load_profile_string_def(conffile,module,"STAT_FILE",maat_stat_file, sizeof(maat_stat_file), "");
- MESA_load_profile_int_def(conffile, module,"EFFECT_INTERVAL_S", &(effect_interval), 60);
- effect_interval*=1000;//convert s to ms
+ MESA_load_profile_int_def(conffile, module,"EFFECT_INTERVAL_MS", &(effect_interval_ms), 60000);
+ MESA_load_profile_int_def(conffile, module,"RULE_UPDATE_CHECK_INTERVAL_MS", &(rule_update_interval_ms), 60000);
+ MESA_load_profile_int_def(conffile, module,"GARBAGE_COLLECT_MS", &(garbage_collect_ms), 60000);
struct maat_options *opts=maat_options_new();
size_t thread_max=(size_t)get_thread_count();
maat_options_set_logger(opts, log_path, (enum log_level)_log_level);
maat_options_set_caller_thread_number(opts, thread_max);
maat_options_set_accept_tags(opts, (const char *)effective_flag);
- maat_options_set_rule_effect_interval_ms(opts, effect_interval);
+ maat_options_set_rule_effect_interval_ms(opts, effect_interval_ms);
maat_options_set_instance_name(opts, instance_name);
+ maat_options_set_foreign_cont_dir(opts, "./alerts_files");
+ maat_options_set_stat_file(opts, maat_stat_file);
+ maat_options_set_rule_update_checking_interval_ms(opts, rule_update_interval_ms);
+ maat_options_set_gc_timeout_ms(opts, garbage_collect_ms);
+
+ if(maat_stat_on==1)
+ {
+ maat_options_set_stat_on(opts);
+ }
+ if(maat_perf_on)
+ {
+ maat_options_set_perf_on(opts);
+ }
+
if(deferred_load==1)
{
maat_options_set_deferred_load_on(opts);