Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

playground: deprecate bootstrap option --monitor and add a new option --without-monitor to disable monitors. #1512

Merged
merged 11 commits into from
Aug 11, 2021
8 changes: 4 additions & 4 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,7 +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, false, "Start prometheus and grafana component")
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 @@ -364,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