Repository navigation
Conversation
2b7fe92 to
799fc85
Compare
|
I am not sure if the abstraction is put in the right place for this feature. I think it would be better of if the Consumer/Producer was hidden behind another layer (either enum or a struct with generic type determining whether its low-level or high-level client), and it gets method injected into the benchmark scenarios, rather than implementing different backends for each one. This way the code would be more composable, currently there is a lot of code that both looks ugly (those associated types such as (Producer, Identifier, Identifer) ), as well as quite a bit repetitive. |
Thank you very much for the feedback! That makes a lot of sense — I’ll go ahead and refactor the code to introduce a unified client trait and inject it into the benchmark logic, as you suggested. This should help reduce duplication and improve composability. Appreciate the detailed suggestion! |
799fc85 to
e13c522
Compare
|
Thanks again for the helpful feedback, @Numinex! I haven’t introduced an enum or generic wrapper yet, as it might add unnecessary complexity at this stage. But if you think it’s still worth doing for better composability, I’m happy to revisit and improve it further. Let me know what you think! |
|
That's definitely step in the right direction. One thing right out of the bat that I would change is moving the This way when implementing pub trait ProducingConsumingClient + ProducerClient + ConsumerClient + BenchmarkSetupSo you don't drag the unnecessary |
e13c522 to
65034ce
Compare
Thanks for the suggestion! I've split setup and api_label into separate traits as proposed, and cleaned up the client traits accordingly. Let me know if anything else needs adjustment. |
|
Btw pull the latest changes @insistedMarin I've merged latest master changes to your branch. |
cfe7aaa to
f8e08f7
Compare
|
Thanks for the feedback @numinnex! 🙌 I've addressed the requested changes: Replaced Box / ProducerClient with generic parameters and removed #[async_trait] by making the traits fully generic. Moved initialization logic into the setup method in BenchmarkInit. Changed api_label from a method to a const in the ApiLabel trait. |
|
Hi @insistedMarin, sorry for late response, I've checked your changes and it looks pretty good overall, I've left one comment, once you resolve it we can merge this PR. |
BTW I've merged master into your branch, so pull the changes before working on it. |
|
Hi @numinnex, thanks for the review! |
|
LGTM, Good job! |
apache#1919) Add HighLevelBackend implementations for producer and producing consumer benchmarks. This enables the `--high-level-api` flag to be used across all benchmark types, completing the support started with the high-level consumer backend. Closes apache#1856 --------- Co-authored-by: Yang Wong <yang wang>
Add HighLevelBackend implementations for producer and producing consumer benchmarks.
This enables the
--high-level-apiflag to be used across all benchmark types, completing the support started with the high-level consumer backend.Closes #1856