Skip to content

Commit

Permalink
no-monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleFall committed Aug 11, 2021
1 parent 05fb473 commit 35d2814
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions components/playground/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ var (

const (
mode = "mode"
withMonitor = "monitor"
withoutMonitor = "no-monitor"

// instance numbers
db = "db"
Expand Down Expand Up @@ -296,8 +296,7 @@ If you'd like to use a TiDB version other than %s, cancel and retry with the fol
defaultOptions := &BootOptions{}

rootCmd.Flags().String(mode, defaultMode, "TiUP playground mode: 'tidb', 'tikv-slim'")
rootCmd.Flags().Bool(withMonitor, true, "Whether to start prometheus and grafana component")
rootCmd.Flags().Lookup(withMonitor).NoOptDefVal = ""
rootCmd.Flags().Bool(withoutMonitor, false, "Don't start prometheus and grafana component")

rootCmd.Flags().Int(db, defaultOptions.TiDB.Num, "TiDB instance number")
rootCmd.Flags().Int(kv, defaultOptions.TiKV.Num, "TiKV instance number")
Expand Down Expand Up @@ -365,12 +364,12 @@ func populateOpt(flagSet *pflag.FlagSet) (err error) {

flagSet.Visit(func(flag *pflag.Flag) {
switch flag.Name {
case withMonitor:
case withoutMonitor:
options.Monitor, err = strconv.ParseBool(flag.Value.String())
if err != nil {
return
}

options.Monitor = !options.Monitor
case db:
options.TiDB.Num, err = strconv.Atoi(flag.Value.String())
if err != nil {
Expand Down

0 comments on commit 35d2814

Please sign in to comment.