Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
Signed-off-by: Cabinfever_B <[email protected]>
  • Loading branch information
CabinfeverB committed Mar 24, 2023
1 parent fd2641e commit 279124d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/resource_group/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ func (gc *groupCostController) modifyTokenCounter(counter *tokenCounter, bucket
cfg.NewTokens = granted
cfg.NewRate = float64(bucket.GetSettings().FillRate)
counter.lastDeadline = time.Time{}
cfg.NotifyThreshold = math.Min((granted+counter.limiter.AvailableTokens(gc.run.now)), counter.avgRUPerSec*defaultTargetPeriod.Seconds()) * notifyFraction
cfg.NotifyThreshold = math.Min(granted+counter.limiter.AvailableTokens(gc.run.now), counter.avgRUPerSec*defaultTargetPeriod.Seconds()) * notifyFraction
if cfg.NewBurst < 0 {
cfg.NewTokens = float64(counter.getTokenBucketFunc().Settings.FillRate)
}
Expand Down
1 change: 1 addition & 0 deletions client/resource_group/controller/limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ func (lim *Limiter) Reconfigure(now time.Time,
defer lim.mu.Unlock()
log.Debug("[resource group controller] before reconfigure", zap.Float64("NewTokens", lim.tokens), zap.Float64("NewRate", float64(lim.limit)), zap.Float64("NotifyThreshold", args.NotifyThreshold), zap.Int64("burst", lim.burst))
if args.NewBurst < 0 {
lim.last = now
lim.tokens = args.NewTokens
} else {
now, _, tokens := lim.advance(now)
Expand Down

0 comments on commit 279124d

Please sign in to comment.