From 9bddb6d020efb21657554c35fd72f3f5e6504d37 Mon Sep 17 00:00:00 2001 From: "zhangkun9038@dingtalk.com" Date: Sat, 29 Mar 2025 21:22:38 +0800 Subject: [PATCH] config --- config/config.go | 17 +++++++++-------- config/config.json | 9 ++++++++- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/config/config.go b/config/config.go index be2c661..cced437 100644 --- a/config/config.go +++ b/config/config.go @@ -43,14 +43,15 @@ type TimeParameters struct { } type DataTypeConfig struct { - IndexPattern string `json:"index_pattern"` - MaxRetention map[string]int `json:"max_retention"` - MinRetention int `json:"min_retention"` - Shards int `json:"shards"` - Replicas int `json:"replicas"` - NormalRollover map[string]string `json:"normal_rollover"` - NormalPhases map[string]int `json:"normal_phases"` - TimeParameters TimeParameters `json:"time_parameters"` + IndexPattern string `json:"index_pattern"` + MaxRetention map[string]int `json:"max_retention"` + MinRetention int `json:"min_retention"` + Shards int `json:"shards"` + Replicas int `json:"replicas"` + NormalRollover map[string]string `json:"normal_rollover"` + NormalPhases map[string]int `json:"normal_phases"` + TimeParameters TimeParameters `json:"time_parameters"` + CoolingModelConfig map[string]float64 `json:"cooling_model_config"` // Add this line } // LoadConfig 加载配置文件 diff --git a/config/config.json b/config/config.json index a18165d..94fdba0 100644 --- a/config/config.json +++ b/config/config.json @@ -42,7 +42,14 @@ "warm": 60, "cold": 180, "delete": 365 - } +}, +"cooling_model_config": { + "timeDecayFactor": 0.5, + "periodGranularityFactor": 0.5, + "warmPhaseMultiplier": 1.0, + "coldPhaseMultiplier": 2.0, + "deletePhaseMultiplier": 3.0 +} }, "ma": { "index_pattern": "logstash-%s.ma.*.%d-%02d",