ConsumeCompleted -> ConsumeCompletedIn #9
Merged
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.
Previously we allowed for measuring the throughput of consumption but not the latency.
This was because it wasnt clear to me how to define latency for consumption.
I am comparing the results of windsock benchmarks against the results of the https://github.com/confluentinc/librdkafka/blob/master/examples/rdkafka_performance.c tool which another team uses for measuring shotover + kafka performance.
I investigated how rdkafka_performance measures latency of consumption:
It stores a timestamp in the record payload at produce time and then compares the payload against the current time at consume time.
This approach makes a lot of sense and we should enable use of this approach in windsock.
This PR adds infrastructure to windsock for measuring consumption latency.
The logic for measuring consumption latency mirrors that of producing latency with one exception:
The durations passed to windsock in
Report::ConsumeCompletedIn
are anOption<Duration>
instead of justDuration
. This allows a None to be passed in the case where the benchmark is testing a payload size so small that it cannot fit a timestamp.Since consumer latency can be None, I took the opportunity to allow the intermediate layers of the producer latency logic to store latency as None. This is used when no messages were sent during the bench, in this case it will now display the latency as
N/A
. Its a rare edge case but still worth handling nicely.windsock codebase
A quick walkthrough of the relevant bits of the windsock codebase:
Report
enum to windsock to keep it up to date with how the bench is going. In this PR, in thereport.rs
file, we replaceReport::ConsumeCompleted
withReport::ConsumeCompletedIn
changing the way the user interacts with windsock to allow them to report consumer latency.Report
s within windsock itself living withinreport.rs
. This PR modifies this so that consumer latency is processed and stored in the final report.tables.rs
takes a windsocks final reports and displays them as ascii tables in the console. In this PR we modify the table to include rows for consumer latency.New table format
This is what the table output looks like now with consume latency: