Skip to content
Snippets Groups Projects
Commit 21ee42e1 authored by Benedikt Wetzel's avatar Benedikt Wetzel Committed by Sören Henning
Browse files

enhance naming

parent f075528f
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!85Introduce new Benchmark class and Patcher,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
This commit is part of merge request !83. Comments created here will be created in the context of that merge request.
......@@ -4,7 +4,7 @@ import theodolite.util.ConfigurationOverride
import kotlin.properties.Delegates
class BenchmarkContext() {
class BenchmarkExecution() {
lateinit var name: String
lateinit var benchmark: String
lateinit var load: LoadDefinition
......
package theodolite.execution
import theodolite.benchmark.BenchmarkContext
import theodolite.benchmark.BenchmarkExecution
import theodolite.benchmark.KubernetesBenchmark
import theodolite.strategies.StrategiesManager
import theodolite.strategies.StrategyFactory
import theodolite.strategies.searchstrategy.CompositeStrategy
import theodolite.util.Config
import theodolite.util.LoadDimension
......@@ -11,14 +11,14 @@ import theodolite.util.Results
import java.time.Duration
class TheodoliteExecutor(
private val config: BenchmarkContext,
private val config: BenchmarkExecution,
private val kubernetesBenchmark: KubernetesBenchmark
)
{
private fun buildConfig(): Config{
val results = Results()
val strategyManager = StrategiesManager()
val strategyFactory = StrategyFactory()
val executionDuration = Duration.ofSeconds(config.execution.duration)
val executor = BenchmarkExecutorImpl(kubernetesBenchmark, results, executionDuration, config.configOverrides)
......@@ -28,8 +28,8 @@ class TheodoliteExecutor(
resources = config.resources.resourceValues.map { resource -> Resource(resource, config.load.loadType) },
compositeStrategy = CompositeStrategy(
benchmarkExecutor = executor,
searchStrategy = strategyManager.createSearchStrategy(executor, config.execution.strategy),
restrictionStrategies = strategyManager.createRestrictionStrategy(results, config.execution.restrictions)),
searchStrategy = strategyFactory.createSearchStrategy(executor, config.execution.strategy),
restrictionStrategies = strategyFactory.createRestrictionStrategy(results, config.execution.restrictions)),
executionDuration = executionDuration)
}
......
package theodolite.execution
import theodolite.benchmark.BenchmarkContext
import theodolite.benchmark.BenchmarkExecution
import theodolite.util.YamlParser
import theodolite.benchmark.KubernetesBenchmark
......@@ -8,11 +8,10 @@ class TheodoliteYamlExecutor {
fun run() {
// load the Benchmark context and the benchmark type
var parser = YamlParser()
val benchmarkContext = parser.parse("./../../../resources/main/yaml/testContext.yaml", BenchmarkContext::class.java) !!
val benchmarkExecution = parser.parse("./../../../resources/main/yaml/testBenchmarkExecution.yaml", BenchmarkExecution::class.java) !!
val benchmark = parser.parse("./../../../resources/main/yaml/testBenchmarkType.yaml", KubernetesBenchmark::class.java) !!
// TheodoliteExecutor benchmarkContext, benchmark
val executor = TheodoliteExecutor(benchmarkContext, benchmark)
val executor = TheodoliteExecutor(benchmarkExecution, benchmark)
executor.run()
}
}
\ No newline at end of file
......@@ -9,7 +9,7 @@ import theodolite.strategies.searchstrategy.SearchStrategy
import theodolite.util.Results
import java.lang.IllegalArgumentException
class StrategiesManager {
class StrategyFactory {
fun createSearchStrategy(executor: BenchmarkExecutor, searchStrategyString: String): SearchStrategy {
return when (searchStrategyString) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment