Skip to content

Commit

Permalink
Merge branch 'master' into grant-cap-net-raw-on-blacbox-exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Mar 29, 2021
2 parents 86b4e8d + 09c186a commit 39088f9
Show file tree
Hide file tree
Showing 38 changed files with 563 additions and 152 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ tidy:
clean:
@rm -rf bin
@rm -rf cover
@rm -rf tests/*/{bin/*.test,logs,cover/*.out}

test: failpoint-enable run-tests failpoint-disable

Expand Down
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 39088f9

Please sign in to comment.