Closed patsonluk closed 9 months ago
Would it be hard to separate the exception handling code into a separate PR for easier review?
Would it be hard to separate the exception handling code into a separate PR for easier review?
They are in these 4 commits :)
@nginthfs Thank you for the detailed reviews, I will merge this in.
We can adjust this by small commits if there are any followups!
Description
solr-bench supports several tasks (indexing/querying etc) and those are embedded in the existing
BenchmarksMain
andStressMain
. It seems that adding more tasks will likely increase the complexity of those code hence we are adding capability of pluggable task class.Other users can implement the new
Task
interface or theAbstractTask
class, the implementation can be placed inside the neworg.apache.solr.benchmarks.task
package or be supplied via other jar and loaded w/o modifying the solr-bench code. The test config can then reference such class by the class name.The full description of usage is documented in https://github.com/fullstorydev/solr-bench/tree/patsonluk/custom-task-class/src/main/java/org/apache/solr/benchmarks/task#readme
Solution
Task
interface andAbstractTask
class. For sub-class ofAbstractTask
we assume that it shares the same config asBaseBenchmark
, which means it also support basic params such asrpm
,duration-secs
etc. The task defined by the implementation is submitted to theControlledExecutor
which has more consistent and centralized control on task executionSegmentMonitoringTask
which monitors total segment count/segment doc size etc, currently this only support reporting metrics to the Prometheus listenerex.printStackTrace()
with logger call. Also addedwaitForSubmittedTasks
method which should interrupt all submitted task and print the exception if any of the submitted tasks failed with unhandled exception. The behavior before was that all tasks would still keep running on unexpected exception and such exception would only be surfaced once all the tests are done