Skip to content

Commit

Permalink
tools/simulator: support simulator with multiple pds (#8304)
Browse files Browse the repository at this point in the history
ref #8135

Signed-off-by: husharp <jinhao.hu@pingcap.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
HuSharp and ti-chi-bot[bot] authored Jun 19, 2024
1 parent fbd6bd2 commit 89ca8df
Show file tree
Hide file tree
Showing 6 changed files with 360 additions and 195 deletions.
3 changes: 0 additions & 3 deletions tools/pd-simulator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/BurntSushi/toml"
"github.com/pingcap/log"
flag "github.com/spf13/pflag"
pdHttp "github.com/tikv/pd/client/http"
"github.com/tikv/pd/pkg/schedule/schedulers"
"github.com/tikv/pd/pkg/statistics"
"github.com/tikv/pd/pkg/utils/logutil"
Expand Down Expand Up @@ -93,7 +92,6 @@ func main() {

func run(simCase string, simConfig *sc.SimConfig) {
if *pdAddr != "" {
simulator.PDHTTPClient = pdHttp.NewClient("pd-simulator", []string{*pdAddr})
simStart(*pdAddr, *statusAddress, simCase, simConfig)
} else {
local, clean := NewSingleServer(context.Background(), simConfig)
Expand All @@ -107,7 +105,6 @@ func run(simCase string, simConfig *sc.SimConfig) {
}
time.Sleep(100 * time.Millisecond)
}
simulator.PDHTTPClient = pdHttp.NewClient("pd-simulator", []string{local.GetAddr()})
simStart(local.GetAddr(), "", simCase, simConfig, clean)
}
}
Expand Down
Loading

0 comments on commit 89ca8df

Please sign in to comment.