-
Notifications
You must be signed in to change notification settings - Fork 84
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
Enable the "received byte count" feature. #2004
Changes from 2 commits
f396a9b
28dd848
c57702e
5087b6b
277eb61
9fadc39
f1aef3c
181b155
4c8e4a7
e854aa4
38c956e
aa64e81
cd95929
b75695c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,6 +153,8 @@ typedef struct { | |
int64_t connection_id; | ||
// The number of internal attempts to carry out a request/operation. 0 if not present. | ||
uint64_t attempt_count; | ||
// The number of bytes received from upstream. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this is close but not 100% accurate right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Concocted something - done. |
||
uint64_t received_byte_count; | ||
} envoy_stream_intel; | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,8 @@ public interface EnvoyStreamIntel { | |
* The number of internal attempts to carry out a request/operation. | ||
*/ | ||
public long getAttemptCount(); | ||
/* | ||
* The number of bytes received from upstream. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. update commments? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comments updated, and also using the same names everywhere. Thanks. |
||
*/ | ||
public long getReceivedByteCount(); | ||
} |
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.
So two ways to address your flaking tests.
You can either look at each point we send stream intel up, and subtract buffered data, or you could send up all received bytes, and all buffered data each time, and calculate "bytes_sent_up = bytes_received - bytes_still_buffered" in cronvoy
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 crux of the problem is on the encodeHeaders invocation, determining how many bytes are left unprocessed is not obvious - there is no Buffer to interrogate.
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.
but on encodeHeaders we pass it all up, no?
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.
Unfortunately, no. The received byte count already includes some coming from the response body. How can we subtract those?