-
Notifications
You must be signed in to change notification settings - Fork 349
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
feature: admissionControl filter #2030
Conversation
5ab2f3a
to
ce6eeea
Compare
0346e82
to
a13acbc
Compare
epsilon := 0.05 * N // maybe 5% instead of 0.1% | ||
expectedFails := (N - failBackend) * ti.pExpectedAdmissionShedding | ||
|
||
if expectedFails-epsilon > fail || fail > expectedFails+epsilon { | ||
t.Errorf("Failed to get expected fails should be in: %0.2f < %0.2f < %0.2f", expectedFails-epsilon, fail, expectedFails+epsilon) | ||
} |
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.
Maybe a comment on what we check here, it is hard to follow.
For the epsilon check maybe it is better to calculate the diff first
diff := math.Abs(fails - expectedFails)
if diff > epsilon {
t.Error(...)
}
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 it's more easy, than you suggestion and if you read it like a math equation it's simpler to follow:
A-e > fail > A+e
a61765d
to
3edd5a7
Compare
…ackend errors admissionControl(metricsSuffix, mode, d, windowSize, minRPS, successThreshold, maxRejectProbability, exponent) admissionControl("myapp", "active", "1s", 5, 10, 0.9, 0.95, 2.0) metricSuffix is the suffix key to expose reject counter, should be unique by filter instance mode is one of "active", "inactive", "log" windowSize is within [minWindowSize, maxWindowSize] minRPS successThreshold is within (0,1] and sets the lowest request success rate at which the filter will not reject requests. maxRejectProbability is within (0,1] and sets the upper bound of reject probability. exponent >0, 1: linear, 1/2: qudratic, .. see also https://opensource.zalando.com/skipper/reference/filters/#admissioncontrol safety: handles background goroutine close on update and delete feature: add preprocessor to remove filter duplicates, last wins Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
d704159
to
97ee825
Compare
cleanup: deleting a filter will close that filter Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
} | ||
|
||
type validationPostProcessorNumberOfFilters struct { | ||
ch chan []*routing.Route |
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.
minor: Maybe it could have *testing.T
field and call t.Error
if admission filter counter is more than one
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.
The problem is that t is not Thread safe. At least in my tests I got warnings or a panic, don't remember anymore.
👍 |
1 similar comment
👍 |
load shedding filter admissionControl, part of #2004
Signed-off-by: Sandor Szücs sandor.szuecs@zalando.de