Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
lucklove authored Mar 29, 2021
2 parents a2b59de + da012e4 commit 7068cc2
Show file tree
Hide file tree
Showing 29 changed files with 450 additions and 131 deletions.
1 change: 1 addition & 0 deletions components/cluster/command/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func newDisplayCmd() *cobra.Command {

cmd.Flags().StringSliceVarP(&gOpt.Roles, "role", "R", nil, "Only display specified roles")
cmd.Flags().StringSliceVarP(&gOpt.Nodes, "node", "N", nil, "Only display specified nodes")
cmd.Flags().BoolVar(&gOpt.ShowUptime, "uptime", false, "Display with uptime")
cmd.Flags().BoolVar(&showDashboardOnly, "dashboard", false, "Only display TiDB Dashboard information")
cmd.Flags().BoolVar(&showVersionOnly, "version", false, "Only display TiDB cluster version")

Expand Down
1 change: 1 addition & 0 deletions components/dm/command/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func newDisplayCmd() *cobra.Command {
cmd.Flags().StringSliceVarP(&gOpt.Roles, "role", "R", nil, "Only display specified roles")
cmd.Flags().StringSliceVarP(&gOpt.Nodes, "node", "N", nil, "Only display specified nodes")
cmd.Flags().BoolVar(&showVersionOnly, "version", false, "Only display DM cluster version")
cmd.Flags().BoolVar(&gOpt.ShowUptime, "uptime", false, "Display DM with uptime")

return cmd
}
4 changes: 3 additions & 1 deletion components/dm/spec/bindversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ func DMComponentVersion(comp, version string) string {
switch comp {
case spec.ComponentAlertmanager,
spec.ComponentGrafana,
spec.ComponentPrometheus:
spec.ComponentPrometheus,
spec.ComponentBlackboxExporter,
spec.ComponentNodeExporter:
return ""
default:
return version
Expand Down
10 changes: 9 additions & 1 deletion components/dm/spec/logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ package spec

import (
"context"
"crypto/tls"
"fmt"
"path/filepath"
"strings"
"time"

"github.com/pingcap/tiup/pkg/logger/log"
"github.com/pingcap/tiup/pkg/meta"
Expand Down Expand Up @@ -88,6 +90,9 @@ func (c *DMMasterComponent) Instances() []Instance {
s.DataDir,
},
StatusFn: s.Status,
UptimeFn: func(tlsCfg *tls.Config) time.Duration {
return spec.UptimeByHost(s.Host, s.Port, tlsCfg)
},
},
topo: c.Topology,
})
Expand Down Expand Up @@ -216,6 +221,9 @@ func (c *DMWorkerComponent) Instances() []Instance {
s.DataDir,
},
StatusFn: s.Status,
UptimeFn: func(tlsCfg *tls.Config) time.Duration {
return spec.UptimeByHost(s.Host, s.Port, tlsCfg)
},
},
topo: c.Topology,
})
Expand Down Expand Up @@ -294,7 +302,7 @@ func (topo *Specification) GetGlobalOptions() spec.GlobalOptions {

// GetMonitoredOptions returns MonitoredOptions
func (topo *Specification) GetMonitoredOptions() *spec.MonitoredOptions {
return nil
return topo.MonitoredOptions
}

// ComponentsByStopOrder return component in the order need to stop.
Expand Down
Loading

0 comments on commit 7068cc2

Please sign in to comment.