-
Notifications
You must be signed in to change notification settings - Fork 616
bechmark: fix cpu sampling #7581
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7581 +/- ##
==========================================
+ Coverage 72.29% 72.30% +0.01%
==========================================
Files 232 232
Lines 34114 34114
==========================================
+ Hits 24662 24667 +5
+ Misses 7676 7673 -3
+ Partials 1776 1774 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2360539 to
a657980
Compare
49840fb to
beedcdd
Compare
Signed-off-by: Huabing Zhao <[email protected]>
beedcdd to
536b6f8
Compare
zirain
approved these changes
Nov 23, 2025
zirain
approved these changes
Nov 24, 2025
zhaohuabing
added a commit
to zhaohuabing/gateway
that referenced
this pull request
Dec 5, 2025
use fixed duration for cpu rate Signed-off-by: Huabing Zhao <[email protected]> (cherry picked from commit 536486f) Signed-off-by: Huabing Zhao <[email protected]>
zhaohuabing
added a commit
that referenced
this pull request
Dec 5, 2025
* fix: oidc authentication endpoint was overwritten by discovered value (#7460) fix: oid authentication endpoint was overriden by discovered value Signed-off-by: Huabing Zhao <[email protected]> Signed-off-by: Huabing (Robin) Zhao <[email protected]> (cherry picked from commit 50dcb15) Signed-off-by: Huabing Zhao <[email protected]> * fix: do not return 500 for all requests when part of BackendRefs are invalid (#7488) * do not return 500 for all requests when part of BackendRefs are invalid Signed-off-by: Huabing Zhao <[email protected]> Signed-off-by: Huabing (Robin) Zhao <[email protected]> (cherry picked from commit 2899416) Signed-off-by: Huabing Zhao <[email protected]> * fix: prevent skeleton route status entries for unmanaged GatewayClasses (#7536) * fix: prevent skeleton route status entries for unmanaged GatewayClasses When processing policies (EnvoyExtensionPolicy, SecurityPolicy), the translator was calling GetRouteParentContext for ALL parentRefs in a route, even those referencing gateways with different GatewayClasses not managed by this translator. GetRouteParentContext creates a skeleton RouteParentStatus entry with just the controllerName when called on a parentRef that hasn't been processed yet. Since all GatewayClass instances share the same controller name, these skeleton entries persisted in status without conditions. The fix checks if a parentRef context already exists before attempting to apply policy configuration to it. If the context doesn't exist, it means this parentRef wasn't processed by this translator and should be skipped. Signed-off-by: Raj Singh <[email protected]> * fix: also prevent skeleton entries in BackendTrafficPolicy processing The same issue exists in BackendTrafficPolicy route processing - calling GetRouteParentContext for all parentRefs creates skeleton status entries. Apply the same fix: check if parentRef context exists before adding to list. Signed-off-by: Raj Singh <[email protected]> --------- Signed-off-by: Raj Singh <[email protected]> (cherry picked from commit ff13742) Signed-off-by: Huabing Zhao <[email protected]> * treat too many addresses as programmed (#7542) Signed-off-by: cong <[email protected]> (cherry picked from commit 7cb5f72) Signed-off-by: Huabing Zhao <[email protected]> * bechmark: fix cpu sampling (#7581) use fixed duration for cpu rate Signed-off-by: Huabing Zhao <[email protected]> (cherry picked from commit 536486f) Signed-off-by: Huabing Zhao <[email protected]> * chore: bump golang.org/x/crypto (#7588) * chore: bump golang.org/x/crypto Signed-off-by: zirain <[email protected]> * fix gen Signed-off-by: zirain <[email protected]> --------- Signed-off-by: zirain <[email protected]> (cherry picked from commit 70fa59a) Signed-off-by: Huabing Zhao <[email protected]> * findOwningGateway should return controller based on linked GatewayClass (#7611) * fix: filter Gateway by controller in findOwningGateway Prevent cross-controller Gateway mutations by validating GatewayClass Signed-off-by: Sudipto Baral <[email protected]> (cherry picked from commit ba8e0e2) Signed-off-by: Huabing Zhao <[email protected]> * fix: use default when namespace is unset (#7612) * fix: use default when namespace is unset Signed-off-by: zirain <[email protected]> * fix Signed-off-by: zirain <[email protected]> * fix test Signed-off-by: zirain <[email protected]> --------- Signed-off-by: zirain <[email protected]> (cherry picked from commit be2cc73) Signed-off-by: Huabing Zhao <[email protected]> * bump Gateway API v1.4.1 (#7653) Signed-off-by: zirain <[email protected]> (cherry picked from commit 0fa26d7) Signed-off-by: Huabing Zhao <[email protected]> * update release note Signed-off-by: Huabing Zhao <[email protected]> * fix gen check Signed-off-by: Huabing Zhao <[email protected]> * ci: add script to free disk space (#7534) * feat: free disk space Signed-off-by: Shreemaan Abhishek <[email protected]> * lint Signed-off-by: Shreemaan Abhishek <[email protected]> * cleanup Signed-off-by: Shreemaan Abhishek <[email protected]> * make target and tools/hack Signed-off-by: Shreemaan Abhishek <[email protected]> * lint Signed-off-by: Shreemaan Abhishek <[email protected]> * modular action Signed-off-by: Shreemaan Abhishek <[email protected]> --------- Signed-off-by: Shreemaan Abhishek <[email protected]> (cherry picked from commit 4312f38) Signed-off-by: Huabing Zhao <[email protected]> --------- Signed-off-by: Huabing Zhao <[email protected]> Signed-off-by: Huabing (Robin) Zhao <[email protected]> Signed-off-by: Raj Singh <[email protected]> Signed-off-by: cong <[email protected]> Signed-off-by: zirain <[email protected]> Signed-off-by: Sudipto Baral <[email protected]> Signed-off-by: Shreemaan Abhishek <[email protected]> Co-authored-by: Raj Singh <[email protected]> Co-authored-by: 聪 <[email protected]> Co-authored-by: zirain <[email protected]> Co-authored-by: Sudipto Baral <[email protected]> Co-authored-by: shreealt <[email protected]>
zhaohuabing
added a commit
to zhaohuabing/gateway
that referenced
this pull request
Dec 17, 2025
use fixed duration for cpu rate Signed-off-by: Huabing Zhao <[email protected]> (cherry picked from commit 536486f) Signed-off-by: Huabing Zhao <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Currently, when calculating the CPU usage, the duration passed to rate() is computed as the time from the test starts to the current sampling time.
Because this %DURATION continuously grows, the query ends up averaging CPU over the entire test run instead of a fixed window for each sample, which makes the reported CPU usage incorrect.
This PR uses a 30s fixed time window for sampling for each sample, and also avoids reading values from the previous test by using
time.Since(startTime)whentime.Since(startTime) < benchmarkCPURateWindow.Before:

min/max/means
min/max/means
After:
min/max/means
min/max/means