Skip to content

Commit

Permalink
Merge pull request #122 from taosdata/fix/database-option-default
Browse files Browse the repository at this point in the history
add metric database option default
  • Loading branch information
sheyanjie-qq committed Jul 2, 2024
2 parents 3971d12 + f7bd364 commit 0a64d6d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/taoskeeper.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ name = "log"
[metrics.database.options]
vgroups = 1
buffer = 64
KEEP = 90
keep = 90
cachemodel = "both"

[environment]
Expand Down
16 changes: 16 additions & 0 deletions infrastructure/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,22 @@ func init() {
_ = viper.BindEnv("metrics.database.name", "TAOS_KEEPER_METRICS_DATABASE")
pflag.String("metrics.database.name", "log", `database for storing metrics data. Env "TAOS_KEEPER_METRICS_DATABASE"`)

viper.SetDefault("metrics.database.options.vgroups", 1)
_ = viper.BindEnv("metrics.database.options.vgroups", "TAOS_KEEPER_METRICS_VGROUPS")
pflag.Int("metrics.database.options.vgroups", 1, `database option vgroups for audit database. Env "TAOS_KEEPER_METRICS_VGROUPS"`)

viper.SetDefault("metrics.database.options.buffer", 64)
_ = viper.BindEnv("metrics.database.options.buffer", "TAOS_KEEPER_METRICS_BUFFER")
pflag.Int("metrics.database.options.buffer", 64, `database option buffer for audit database. Env "TAOS_KEEPER_METRICS_BUFFER"`)

viper.SetDefault("metrics.database.options.keep", 90)
_ = viper.BindEnv("metrics.database.options.keep", "TAOS_KEEPER_METRICS_KEEP")
pflag.Int("metrics.database.options.keep", 90, `database option buffer for audit database. Env "TAOS_KEEPER_METRICS_KEEP"`)

viper.SetDefault("metrics.database.options.cachemodel", "both")
_ = viper.BindEnv("metrics.database.options.cachemodel", "TAOS_KEEPER_METRICS_CACHEMODEL")
pflag.String("metrics.database.options.cachemodel", "both", `database option cachemodel for audit database. Env "TAOS_KEEPER_METRICS_CACHEMODEL"`)

viper.SetDefault("metrics.tables", []string{})
_ = viper.BindEnv("metrics.tables", "TAOS_KEEPER_METRICS_TABLES")
pflag.StringArray("metrics.tables", []string{}, `export some tables that are not super table, multiple values split with white space. Env "TAOS_KEEPER_METRICS_TABLES"`)
Expand Down

0 comments on commit 0a64d6d

Please sign in to comment.