fullstorydev / solr-bench

Solr benchmarking and load testing harness
Apache License 2.0
17 stars 10 forks source link

Refactoring on Benchmark beans - a shared abstract base class `BaseBenchmark` #49

Closed patsonluk closed 1 year ago

patsonluk commented 1 year ago

Descriptions

Extract a base class BaseBenchmark as IndexBenchmark and QueryBenchmark have certain overlapping common properties.

And this paves way for better sharing of the ControlledExecutor.

Currently only QueryBenchmark uses ControlledExecutor which controls both rpm (run per minute) and duration (run duration), while IndexBenchmark although has very similar parameters (rpm and durationSecs), it's not suing ControlledExecutor and is using its own implementation to control rpm of index operation and durationSecs does not work.

Also the list of Setup under IndexBenchmark does not appear to work in all places (probably a WIP?), while there are places that seems to iterate over the setup to index accordingly, but the caller would only use the first in the list for collection name to index

Some of the values are extracted from Setup and moved up to IndexBenchmark for this refactoring practice. I do not want to completely rip out Setup for now as there could be some valid use case that I did not consider.

However, I would propose instead of allowing different Setups within the IndexBenchmark, perhaps just flatten all the values from Setup to IndexBenchmark (ie only 1 setup per IndexBenchmark, so far in suites I have only seen single setup). If the user wants different setups, then just set it up as a new task-type instead? Anyway, don't want to make major refactoring for now.