Skip to content

Commit 6847683

Browse files
committed
Adjust concurrency logic and metrics in the concurrency package, and improve debugging output
1 parent 0b87514 commit 6847683

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

concurrency/metrics.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,16 @@ func (ch *ConcurrencyHandler) EvaluateAndAdjustConcurrency(resp *http.Response,
8080
}
8181

8282
// Check critical thresholds
83-
if rateLimitFeedback <= RateLimitCriticalThreshold || weightedResponseCodeScore >= ErrorResponseThreshold {
84-
ch.logger.Warn("Scaling down due to critical threshold breach",
85-
zap.String("event", "CriticalThresholdBreach"),
86-
zap.Int("rateLimitFeedback", rateLimitFeedback),
87-
zap.Float64("errorResponseRate", weightedResponseCodeScore),
88-
)
89-
ch.ScaleDown()
90-
return
83+
if rateLimitFeedback <= RateLimitCriticalThreshold || responseCodeFeedback < 0 {
84+
if weightedRateLimitScore >= ErrorResponseThreshold || weightedResponseCodeScore >= ErrorResponseThreshold {
85+
ch.logger.Warn("Scaling down due to critical threshold breach",
86+
zap.String("event", "CriticalThresholdBreach"),
87+
zap.Int("rateLimitFeedback", rateLimitFeedback),
88+
zap.Float64("errorResponseRate", weightedResponseCodeScore),
89+
)
90+
ch.ScaleDown()
91+
return
92+
}
9193
}
9294

9395
// Evaluate cumulative impact and make a scaling decision based on the cumulative score and other metrics.

0 commit comments

Comments
 (0)