Surface per-server stats on BrokerResponse for SSE queries#18602
Merged
xiangfu0 merged 1 commit intoMay 28, 2026
Conversation
046e4e4 to
735c830
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18602 +/- ##
============================================
+ Coverage 64.27% 64.37% +0.09%
Complexity 1137 1137
============================================
Files 3335 3336 +1
Lines 206006 206101 +95
Branches 32133 32145 +12
============================================
+ Hits 132420 132685 +265
+ Misses 62940 62758 -182
- Partials 10646 10658 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gortiz
reviewed
May 28, 2026
735c830 to
2620e97
Compare
Contributor
Author
|
Good call — moved off the interface. Latest push:
Tests still 8/8 pass; checkstyle clean. |
2620e97 to
1754a71
Compare
Per-server scatter stats (submit delay, response delay, response size, deserialization timing) are computed by the Netty single-connection transport during scatter and stashed on a local ServerStats holder inside BaseSingleStageBrokerRequestHandler.handleRequest. Today the formatted string only reaches the SLF4J QueryLogger that consumes the holder before handleRequest returns; subscribers of the onQueryCompletion(RequestContext, BrokerResponse) hook and JSON-API clients have no way to read it because neither RequestContext nor BrokerResponse exposes it. This commit exposes the string on BrokerResponse, mirroring the existing materializedViewQueried pattern: default getter on the BrokerResponse interface (returns null so external implementations need no override), concrete field + setter + Jackson-annotated getter on BrokerResponseNative, and @JsonInclude(NON_NULL) so existing clients that do not expect the field see no behavioral change. BaseSingleStageBrokerRequestHandler#handleRequest writes the value onto the response after scatter completes, both on the regular path and the materialized-view split path. Only the Netty SSE transport produces a non-null value today; gRPC SSE and MSE leave it null because OSS does not currently compute a per-server stats string on those paths. Tests in BrokerResponseNativeTest pin (1) JSON round-trip, (2) suppression of the field when null, and (3) the null default.
1754a71 to
a87229e
Compare
gortiz
approved these changes
May 28, 2026
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
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.
Expose serverStats in SSE broker response.