-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support streaming inputs in CLI tooling #1477
Conversation
This change does not integrate streaming into report collector yet as we're not quite ready for it. But it provides a means to split a `BufRead` interface into `M` streams that read from it one at a time. This should not require reading the entire file in memory in order to submit it. There are a few things that I decided not to bring in the first version: * Reading from a file can be done in async runtime using `AsyncRead` interface. The benefit of it is not clear to me atm. * reading more than one line at a time. We could support reading lets say 8kb chunks from file and then let HTTP streams to stream it out.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1477 +/- ##
==========================================
- Coverage 93.86% 93.78% -0.08%
==========================================
Files 235 236 +1
Lines 42451 42837 +386
==========================================
+ Hits 39845 40174 +329
- Misses 2606 2663 +57 ☔ View full report in Codecov by Sentry. |
// but probably it does not matter for this code as it is not on the hot path | ||
if state.idx == self.idx { | ||
let poll = state.read_next(); | ||
if poll.is_ready() { |
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.
does read_next only return Poll::Ready?
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.
no, but only if it is ready, we want to advance the index
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.
Is reading just one line going to be slow?
|
||
proptest! { | ||
#[test] | ||
fn proptest_round_robin(input: Vec<String>, count in 1_usize..953) { |
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.
what is this secret number?
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.
nothing really, just something that is not large enough to cause proptests to run forever
This change does not integrate streaming into report collector yet as we're not quite ready for it. But it provides a means to split a
BufRead
interface intoM
streams that read from it one at a time. This should not require reading the entire file in memory in order to submit it.There are a few things that I decided not to bring in the first version:
AsyncRead
interface. The benefit of it is not clear to me atm.