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

make loadGenerationDelay optinal

parent f8136652
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !135. Comments created here will be created in the context of that merge request.
Showing
with 14 additions and 14 deletions
...@@ -22,7 +22,7 @@ loadTypes: ...@@ -22,7 +22,7 @@ loadTypes:
- type: "NumSensorsLoadGeneratorReplicaPatcher" - type: "NumSensorsLoadGeneratorReplicaPatcher"
resource: "uc1-load-generator-deployment.yaml" resource: "uc1-load-generator-deployment.yaml"
kafkaConfig: kafkaConfig:
bootstrapServer: "theodolite-cp-kafka:9092" bootstrapServer: "localhost:31290"
topics: topics:
- name: "input" - name: "input"
numPartitions: 40 numPartitions: 40
......
...@@ -17,7 +17,7 @@ execution: ...@@ -17,7 +17,7 @@ execution:
strategy: "LinearSearch" strategy: "LinearSearch"
duration: 300 # in seconds duration: 300 # in seconds
repetitions: 1 repetitions: 1
delay: 30 # in seconds loadGenerationDelay: 30 # in seconds, optional field, default is 0 seconds
restrictions: restrictions:
- "LowerBound" - "LowerBound"
configOverrides: [] configOverrides: []
......
...@@ -47,7 +47,7 @@ class BenchmarkExecution : CustomResource(), Namespaced { ...@@ -47,7 +47,7 @@ class BenchmarkExecution : CustomResource(), Namespaced {
var duration by Delegates.notNull<Long>() var duration by Delegates.notNull<Long>()
var repetitions by Delegates.notNull<Int>() var repetitions by Delegates.notNull<Int>()
lateinit var restrictions: List<String> lateinit var restrictions: List<String>
var delay by Delegates.notNull<Long>() var loadGenerationDelay = 0L
} }
/** /**
......
...@@ -71,7 +71,7 @@ class KubernetesBenchmark : Benchmark, CustomResource(), Namespaced { ...@@ -71,7 +71,7 @@ class KubernetesBenchmark : Benchmark, CustomResource(), Namespaced {
load: LoadDimension, load: LoadDimension,
res: Resource, res: Resource,
configurationOverrides: List<ConfigurationOverride?>, configurationOverrides: List<ConfigurationOverride?>,
delay: Long loadGenerationDelay: Long
): BenchmarkDeployment { ): BenchmarkDeployment {
logger.info { "Using $namespace as namespace." } logger.info { "Using $namespace as namespace." }
logger.info { "Using $path as resource path." } logger.info { "Using $path as resource path." }
...@@ -99,7 +99,7 @@ class KubernetesBenchmark : Benchmark, CustomResource(), Namespaced { ...@@ -99,7 +99,7 @@ class KubernetesBenchmark : Benchmark, CustomResource(), Namespaced {
namespace = namespace, namespace = namespace,
appResources = appResources.map { it.second }, appResources = appResources.map { it.second },
loadGenResources = loadGenResources.map { it.second }, loadGenResources = loadGenResources.map { it.second },
delay = delay, loadGenerationDelay = loadGenerationDelay,
kafkaConfig = hashMapOf("bootstrap.servers" to kafkaConfig.bootstrapServer), kafkaConfig = hashMapOf("bootstrap.servers" to kafkaConfig.bootstrapServer),
topics = kafkaConfig.topics, topics = kafkaConfig.topics,
client = DefaultKubernetesClient().inNamespace(namespace) client = DefaultKubernetesClient().inNamespace(namespace)
......
...@@ -25,7 +25,7 @@ class KubernetesBenchmarkDeployment( ...@@ -25,7 +25,7 @@ class KubernetesBenchmarkDeployment(
val namespace: String, val namespace: String,
val appResources: List<KubernetesResource>, val appResources: List<KubernetesResource>,
val loadGenResources: List<KubernetesResource>, val loadGenResources: List<KubernetesResource>,
private val delay: Long, private val loadGenerationDelay: Long,
private val kafkaConfig: HashMap<String, Any>, private val kafkaConfig: HashMap<String, Any>,
private val topics: List<KafkaConfig.TopicWrapper>, private val topics: List<KafkaConfig.TopicWrapper>,
private val client: NamespacedKubernetesClient private val client: NamespacedKubernetesClient
...@@ -45,8 +45,8 @@ class KubernetesBenchmarkDeployment( ...@@ -45,8 +45,8 @@ class KubernetesBenchmarkDeployment(
.map{ NewTopic(it.name, it.numPartitions, it.replicationFactor) } .map{ NewTopic(it.name, it.numPartitions, it.replicationFactor) }
kafkaController.createTopics(kafkaTopics) kafkaController.createTopics(kafkaTopics)
appResources.forEach { kubernetesManager.deploy(it) } appResources.forEach { kubernetesManager.deploy(it) }
logger.info { "Wait ${this.delay} seconds before starting the workload generator." } logger.info { "Wait ${this.loadGenerationDelay} seconds before starting the workload generator." }
Thread.sleep(Duration.ofSeconds(this.delay).toMillis()) Thread.sleep(Duration.ofSeconds(this.loadGenerationDelay).toMillis())
loadGenResources.forEach { kubernetesManager.deploy(it) } loadGenResources.forEach { kubernetesManager.deploy(it) }
} }
......
...@@ -27,7 +27,7 @@ abstract class BenchmarkExecutor( ...@@ -27,7 +27,7 @@ abstract class BenchmarkExecutor(
val configurationOverrides: List<ConfigurationOverride?>, val configurationOverrides: List<ConfigurationOverride?>,
val slo: BenchmarkExecution.Slo, val slo: BenchmarkExecution.Slo,
val executionId: Int, val executionId: Int,
val delay: Long val loadGenerationDelay: Long
) { ) {
var run: AtomicBoolean = AtomicBoolean(true) var run: AtomicBoolean = AtomicBoolean(true)
......
...@@ -21,11 +21,11 @@ class BenchmarkExecutorImpl( ...@@ -21,11 +21,11 @@ class BenchmarkExecutorImpl(
configurationOverrides: List<ConfigurationOverride?>, configurationOverrides: List<ConfigurationOverride?>,
slo: BenchmarkExecution.Slo, slo: BenchmarkExecution.Slo,
executionId: Int, executionId: Int,
delay: Long loadGenerationDelay: Long
) : BenchmarkExecutor(benchmark, results, executionDuration, configurationOverrides, slo, executionId, delay) { ) : BenchmarkExecutor(benchmark, results, executionDuration, configurationOverrides, slo, executionId, loadGenerationDelay) {
override fun runExperiment(load: LoadDimension, res: Resource): Boolean { override fun runExperiment(load: LoadDimension, res: Resource): Boolean {
var result = false var result = false
val benchmarkDeployment = benchmark.buildDeployment(load, res, configurationOverrides, delay) val benchmarkDeployment = benchmark.buildDeployment(load, res, configurationOverrides, loadGenerationDelay)
try { try {
benchmarkDeployment.setup() benchmarkDeployment.setup()
......
...@@ -31,7 +31,7 @@ class Shutdown(private val benchmarkExecution: BenchmarkExecution, private val b ...@@ -31,7 +31,7 @@ class Shutdown(private val benchmarkExecution: BenchmarkExecution, private val b
load = LoadDimension(0, emptyList()), load = LoadDimension(0, emptyList()),
res = Resource(0, emptyList()), res = Resource(0, emptyList()),
configurationOverrides = benchmarkExecution.configOverrides, configurationOverrides = benchmarkExecution.configOverrides,
delay = 0L loadGenerationDelay = 0L
) )
deployment.teardown() deployment.teardown()
} catch (e: Exception) { } catch (e: Exception) {
......
...@@ -72,7 +72,7 @@ class TheodoliteExecutor( ...@@ -72,7 +72,7 @@ class TheodoliteExecutor(
configurationOverrides = config.configOverrides, configurationOverrides = config.configOverrides,
slo = config.slos[0], slo = config.slos[0],
executionId = config.executionId, executionId = config.executionId,
delay = config.execution.delay loadGenerationDelay = config.execution.loadGenerationDelay
) )
return Config( return Config(
......
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