Skip to content

Commit

Permalink
Merge branch 'master' into ngm_metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis authored Mar 24, 2022
2 parents fa35a72 + 9798f51 commit 0c7e437
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/bench/ycsb.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ func registerYcsb(root *cobra.Command) {
cmd.PersistentFlags().Uint32Var(&config.ConnCount, "conncount", 128, "Connection Count")
cmd.PersistentFlags().BoolVar(&config.ReadAllFields, "readallfields", true, "Whether Read All Fields")

cmd.PersistentFlags().Float32Var(&config.ReadProportion, "readproportion", 0, "What proportion of operations are reads")
cmd.PersistentFlags().Float32Var(&config.UpdateProportion, "updateproportion", 0, "What proportion of operations are updates")
cmd.PersistentFlags().Float32Var(&config.ScanProportion, "scanproportion", 0, "What proportion of operations are scans")
cmd.PersistentFlags().Float32Var(&config.InsertProportion, "insertproportion", 0, "What proportion of operations are inserts")
cmd.PersistentFlags().Float32Var(&config.ReadModifyWriteProportion, "readmodifywriteproportion", 0, "What proportion of operations are read-modify-write")
cmd.PersistentFlags().Float32Var(&config.ReadProportion, "readproportion", 0.95, "What proportion of operations are reads, default 0.95")
cmd.PersistentFlags().Float32Var(&config.UpdateProportion, "updateproportion", 0.05, "What proportion of operations are updates, default 0.05")
cmd.PersistentFlags().Float32Var(&config.ScanProportion, "scanproportion", 0, "What proportion of operations are scans, default 0")
cmd.PersistentFlags().Float32Var(&config.InsertProportion, "insertproportion", 0, "What proportion of operations are inserts, default 0")
cmd.PersistentFlags().Float32Var(&config.ReadModifyWriteProportion, "readmodifywriteproportion", 0, "What proportion of operations are read-modify-write, default 0")

cmd.PersistentFlags().StringVar(&config.RequestDistribution, "requestdistribution", "uniform", "The distribution of requests across the keyspace, [zipfian, uniform, latest]")

Expand Down
3 changes: 3 additions & 0 deletions pkg/cluster/spec/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,9 @@ func (s *Specification) portConflictsDetect() error {
"WebPort",
"TCPPort",
"HTTPPort",
"FlashServicePort",
"FlashProxyPort",
"FlashProxyStatusPort",
"ClusterPort",
"NgPort",
}
Expand Down
52 changes: 52 additions & 0 deletions pkg/cluster/spec/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,58 @@ tikv_servers:
c.Assert(err, NotNil)
c.Assert(err.Error(), Equals, "port conflict for '1234' between 'tidb_servers:172.16.5.138.port' and 'tikv_servers:172.16.5.138.status_port'")

topo = Specification{}
err = yaml.Unmarshal([]byte(`
global:
user: "test1"
ssh_port: 220
deploy_dir: "test-deploy"
data_dir: "test-data"
tiflash_servers:
- host: 172.16.5.138
tcp_port: 111
http_port: 222
flash_service_port: 1234
flash_proxy_port: 444
flash_proxy_status_port: 555
metrics_port: 666
- host: 172.16.5.138
tcp_port: 1111
http_port: 1222
flash_service_port: 1333
flash_proxy_port: 1444
flash_proxy_status_port: 1234
metrics_port: 1666
`), &topo)
c.Assert(err, NotNil)
c.Assert(err.Error(), Equals, "port conflict for '1234' between 'tiflash_servers:172.16.5.138.flash_service_port' and 'tiflash_servers:172.16.5.138.flash_proxy_status_port'")

topo = Specification{}
err = yaml.Unmarshal([]byte(`
global:
user: "test1"
ssh_port: 220
deploy_dir: "test-deploy"
data_dir: "test-data"
tiflash_servers:
- host: 172.16.5.138
tcp_port: 111
http_port: 222
flash_service_port: 333
flash_proxy_port: 1234
flash_proxy_status_port: 555
metrics_port: 666
- host: 172.16.5.138
tcp_port: 1111
http_port: 1222
flash_service_port: 1333
flash_proxy_port: 1234
flash_proxy_status_port: 1555
metrics_port: 1666
`), &topo)
c.Assert(err, NotNil)
c.Assert(err.Error(), Equals, "port conflict for '1234' between 'tiflash_servers:172.16.5.138.flash_proxy_port' and 'tiflash_servers:172.16.5.138.flash_proxy_port'")

topo = Specification{}
// tispark_masters has "omitempty" in its tag value
err = yaml.Unmarshal([]byte(`
Expand Down

0 comments on commit 0c7e437

Please sign in to comment.