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
...@@ -4,7 +4,7 @@ import theodolite.util.ConfigurationOverride ...@@ -4,7 +4,7 @@ import theodolite.util.ConfigurationOverride
import kotlin.properties.Delegates import kotlin.properties.Delegates
class BenchmarkContext() { class BenchmarkExecution() {
lateinit var name: String lateinit var name: String
lateinit var benchmark: String lateinit var benchmark: String
lateinit var load: LoadDefinition lateinit var load: LoadDefinition
......
package theodolite.execution package theodolite.execution
import theodolite.benchmark.BenchmarkContext import theodolite.benchmark.BenchmarkExecution
import theodolite.benchmark.KubernetesBenchmark import theodolite.benchmark.KubernetesBenchmark
import theodolite.strategies.StrategiesManager import theodolite.strategies.StrategyFactory
import theodolite.strategies.searchstrategy.CompositeStrategy import theodolite.strategies.searchstrategy.CompositeStrategy
import theodolite.util.Config import theodolite.util.Config
import theodolite.util.LoadDimension import theodolite.util.LoadDimension
...@@ -11,14 +11,14 @@ import theodolite.util.Results ...@@ -11,14 +11,14 @@ import theodolite.util.Results
import java.time.Duration import java.time.Duration
class TheodoliteExecutor( class TheodoliteExecutor(
private val config: BenchmarkContext, private val config: BenchmarkExecution,
private val kubernetesBenchmark: KubernetesBenchmark private val kubernetesBenchmark: KubernetesBenchmark
) )
{ {
private fun buildConfig(): Config{ private fun buildConfig(): Config{
val results = Results() val results = Results()
val strategyManager = StrategiesManager() val strategyFactory = StrategyFactory()
val executionDuration = Duration.ofSeconds(config.execution.duration) val executionDuration = Duration.ofSeconds(config.execution.duration)
val executor = BenchmarkExecutorImpl(kubernetesBenchmark, results, executionDuration, config.configOverrides) val executor = BenchmarkExecutorImpl(kubernetesBenchmark, results, executionDuration, config.configOverrides)
...@@ -28,8 +28,8 @@ class TheodoliteExecutor( ...@@ -28,8 +28,8 @@ class TheodoliteExecutor(
resources = config.resources.resourceValues.map { resource -> Resource(resource, config.load.loadType) }, resources = config.resources.resourceValues.map { resource -> Resource(resource, config.load.loadType) },
compositeStrategy = CompositeStrategy( compositeStrategy = CompositeStrategy(
benchmarkExecutor = executor, benchmarkExecutor = executor,
searchStrategy = strategyManager.createSearchStrategy(executor, config.execution.strategy), searchStrategy = strategyFactory.createSearchStrategy(executor, config.execution.strategy),
restrictionStrategies = strategyManager.createRestrictionStrategy(results, config.execution.restrictions)), restrictionStrategies = strategyFactory.createRestrictionStrategy(results, config.execution.restrictions)),
executionDuration = executionDuration) executionDuration = executionDuration)
} }
......
package theodolite.execution package theodolite.execution
import theodolite.benchmark.BenchmarkContext import theodolite.benchmark.BenchmarkExecution
import theodolite.util.YamlParser import theodolite.util.YamlParser
import theodolite.benchmark.KubernetesBenchmark import theodolite.benchmark.KubernetesBenchmark
...@@ -8,11 +8,10 @@ class TheodoliteYamlExecutor { ...@@ -8,11 +8,10 @@ class TheodoliteYamlExecutor {
fun run() { fun run() {
// load the Benchmark context and the benchmark type // load the Benchmark context and the benchmark type
var parser = YamlParser() 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) !! val benchmark = parser.parse("./../../../resources/main/yaml/testBenchmarkType.yaml", KubernetesBenchmark::class.java) !!
// TheodoliteExecutor benchmarkContext, benchmark val executor = TheodoliteExecutor(benchmarkExecution, benchmark)
val executor = TheodoliteExecutor(benchmarkContext, benchmark)
executor.run() executor.run()
} }
} }
\ No newline at end of file
...@@ -9,7 +9,7 @@ import theodolite.strategies.searchstrategy.SearchStrategy ...@@ -9,7 +9,7 @@ import theodolite.strategies.searchstrategy.SearchStrategy
import theodolite.util.Results import theodolite.util.Results
import java.lang.IllegalArgumentException import java.lang.IllegalArgumentException
class StrategiesManager { class StrategyFactory {
fun createSearchStrategy(executor: BenchmarkExecutor, searchStrategyString: String): SearchStrategy { fun createSearchStrategy(executor: BenchmarkExecutor, searchStrategyString: String): SearchStrategy {
return when (searchStrategyString) { return when (searchStrategyString) {
......
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