Skip to content
Snippets Groups Projects
Commit 4c70e44c authored by Sören Henning's avatar Sören Henning
Browse files

Cont. add FullSearch strategy

parent 34bde357
No related branches found
No related tags found
3 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
...@@ -8,18 +8,24 @@ import theodolite.util.Resource ...@@ -8,18 +8,24 @@ import theodolite.util.Resource
private val logger = KotlinLogging.logger {} private val logger = KotlinLogging.logger {}
/** /**
* Linear-search-like implementation for determining the smallest suitable number of instances. * [SearchStrategy] that executes experiment for provides resources in a linear-search-like fashion, but **without
* stopping** once a suitable resource amount is found.
*
* @see LinearSearch for a SearchStrategy that stops once a suitable resource amount is found.
* *
* @param benchmarkExecutor Benchmark executor which runs the individual benchmarks. * @param benchmarkExecutor Benchmark executor which runs the individual benchmarks.
*/ */
class LinearSearch(benchmarkExecutor: BenchmarkExecutor) : SearchStrategy(benchmarkExecutor) { class FullSearch(benchmarkExecutor: BenchmarkExecutor) : SearchStrategy(benchmarkExecutor) {
override fun findSuitableResource(load: LoadDimension, resources: List<Resource>): Resource? { override fun findSuitableResource(load: LoadDimension, resources: List<Resource>): Resource? {
var minimalSuitableResources: Resource? = null;
for (res in resources) { for (res in resources) {
logger.info { "Running experiment with load '$load' and resources '$res'" } logger.info { "Running experiment with load '$load' and resources '$res'" }
if (this.benchmarkExecutor.runExperiment(load, res)) return res val result = this.benchmarkExecutor.runExperiment(load, res)
if (result && minimalSuitableResources != null) {
minimalSuitableResources = res
}
} }
return null return minimalSuitableResources
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment