-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polish Thanos Receive load shedding #118
Conversation
3a542ba
to
f2673be
Compare
f2673be
to
209f0e8
Compare
209f0e8
to
5438a46
Compare
} | ||
|
||
func (l *Limiter) DecrementPendingRequests() { | ||
newValue := l.pendingRequests.Add(-1) | ||
if l.pendingRequestsGauge != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this would be nil?
if l.maxPendingRequestLimitHit != nil { | ||
l.maxPendingRequestLimitHit.Inc() | ||
} | ||
if l.pendingRequestsGauge != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think tracking pending request should always on, check nil seems unnecessary and hurts the code readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add unit tests in a follow-up PR