Skip to content

Commit

Permalink
tools: support more qps for api bench (#7890)
Browse files Browse the repository at this point in the history
close #7703

Signed-off-by: Cabinfever_B <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
CabinfeverB and ti-chi-bot[bot] authored Mar 8, 2024
1 parent bbd3bdb commit 46c8a6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/pd-api-bench/cases/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func (c *httpController) run() {
qps := c.GetQPS()
burst := c.GetBurst()
cliNum := int64(len(c.clients))
tt := time.Duration(base/qps*burst*cliNum) * time.Microsecond
tt := time.Duration(base*burst*cliNum/qps) * time.Microsecond
log.Info("begin to run http case", zap.String("case", c.Name()), zap.Int64("qps", qps), zap.Int64("burst", burst), zap.Duration("interval", tt))
for _, hCli := range c.clients {
c.wg.Add(1)
Expand Down Expand Up @@ -283,7 +283,7 @@ func (c *gRPCController) run() {
qps := c.GetQPS()
burst := c.GetBurst()
cliNum := int64(len(c.clients))
tt := time.Duration(base/qps*burst*cliNum) * time.Microsecond
tt := time.Duration(base*burst*cliNum/qps) * time.Microsecond
log.Info("begin to run gRPC case", zap.String("case", c.Name()), zap.Int64("qps", qps), zap.Int64("burst", burst), zap.Duration("interval", tt))
for _, cli := range c.clients {
c.wg.Add(1)
Expand Down Expand Up @@ -352,7 +352,7 @@ func (c *etcdController) run() {
qps := c.GetQPS()
burst := c.GetBurst()
cliNum := int64(len(c.clients))
tt := time.Duration(base/qps*burst*cliNum) * time.Microsecond
tt := time.Duration(base*burst*cliNum/qps) * time.Microsecond
log.Info("begin to run etcd case", zap.String("case", c.Name()), zap.Int64("qps", qps), zap.Int64("burst", burst), zap.Duration("interval", tt))
err := c.Init(c.ctx, c.clients[0])
if err != nil {
Expand Down

0 comments on commit 46c8a6f

Please sign in to comment.