Skip to content
Snippets Groups Projects
Commit fa21b5a8 authored by Marcel Samir Becker's avatar Marcel Samir Becker
Browse files

Started splitting into new package structure

parent 7071dcb7
No related branches found
No related tags found
1 merge request!256Restructure package and class structure of Theodolite
Showing
with 59 additions and 56 deletions
package theodolite.strategies
package rocks.theodolite.core.strategies
enum class Metric(val value: String) {
DEMAND("demand"),
......
package theodolite.strategies
package rocks.theodolite.core.strategies
import theodolite.benchmark.BenchmarkExecution
import theodolite.execution.BenchmarkExecutor
import theodolite.strategies.restriction.LowerBoundRestriction
import theodolite.strategies.restriction.RestrictionStrategy
import theodolite.strategies.searchstrategy.*
import theodolite.util.Results
import rocks.theodolite.core.strategies.guessstrategy.PrevInstanceOptGuess
import rocks.theodolite.kubernetes.benchmark.BenchmarkExecution
import rocks.theodolite.core.strategies.restrictionstrategy.LowerBoundRestriction
import rocks.theodolite.core.strategies.restrictionstrategy.RestrictionStrategy
import rocks.theodolite.core.strategies.searchstrategy.*
import rocks.theodolite.kubernetes.execution.BenchmarkExecutor
import rocks.theodolite.core.util.Results
/**
* Factory for creating [SearchStrategy] and [RestrictionStrategy] strategies.
......@@ -40,7 +41,7 @@ class StrategyFactory {
"Search Strategy ${searchStrategyObject.searchStrategy} for RestrictionSearch not found")
}
"InitialGuessSearch" -> when (searchStrategyObject.guessStrategy){
"PrevResourceMinGuess" -> InitialGuessSearchStrategy(executor,PrevInstanceOptGuess(), results)
"PrevResourceMinGuess" -> InitialGuessSearchStrategy(executor, PrevInstanceOptGuess(), results)
else -> throw IllegalArgumentException("Guess Strategy ${searchStrategyObject.guessStrategy} not found")
}
else -> throw IllegalArgumentException("Search Strategy $searchStrategyObject not found")
......
package theodolite.strategies.searchstrategy
package rocks.theodolite.core.strategies.guessstrategy
import io.quarkus.runtime.annotations.RegisterForReflection
......
package theodolite.strategies.searchstrategy
package rocks.theodolite.core.strategies.guessstrategy
/**
......
package theodolite.strategies.restriction
package rocks.theodolite.core.strategies.restrictionstrategy
import theodolite.util.Results
import rocks.theodolite.core.util.Results
/**
* The [LowerBoundRestriction] sets the lower bound of the resources to be examined in the experiment to the value
......
package theodolite.strategies.restriction
package rocks.theodolite.core.strategies.restrictionstrategy
import io.quarkus.runtime.annotations.RegisterForReflection
import theodolite.util.Results
import rocks.theodolite.core.util.Results
/**
* A 'Restriction Strategy' restricts a list of resources or loads depending on the metric based on the current
......
package theodolite.strategies.searchstrategy
package rocks.theodolite.core.strategies.searchstrategy
import mu.KotlinLogging
import theodolite.execution.BenchmarkExecutor
import rocks.theodolite.kubernetes.execution.BenchmarkExecutor
private val logger = KotlinLogging.logger {}
......
package theodolite.strategies.searchstrategy
package rocks.theodolite.core.strategies.searchstrategy
import mu.KotlinLogging
import theodolite.execution.BenchmarkExecutor
import rocks.theodolite.kubernetes.execution.BenchmarkExecutor
private val logger = KotlinLogging.logger {}
......
package theodolite.strategies.searchstrategy
package rocks.theodolite.core.strategies.searchstrategy
import mu.KotlinLogging
import theodolite.execution.BenchmarkExecutor
import theodolite.util.Results
import rocks.theodolite.core.strategies.guessstrategy.GuessStrategy
import rocks.theodolite.kubernetes.execution.BenchmarkExecutor
import rocks.theodolite.core.util.Results
private val logger = KotlinLogging.logger {}
......
package theodolite.strategies.searchstrategy
package rocks.theodolite.core.strategies.searchstrategy
import mu.KotlinLogging
import theodolite.execution.BenchmarkExecutor
import rocks.theodolite.kubernetes.execution.BenchmarkExecutor
private val logger = KotlinLogging.logger {}
......
package theodolite.strategies.searchstrategy
package rocks.theodolite.core.strategies.searchstrategy
import io.quarkus.runtime.annotations.RegisterForReflection
import theodolite.execution.BenchmarkExecutor
import theodolite.strategies.restriction.RestrictionStrategy
import rocks.theodolite.core.strategies.restrictionstrategy.RestrictionStrategy
import rocks.theodolite.kubernetes.execution.BenchmarkExecutor
/**
* Strategy that combines a SearchStrategy and a set of RestrictionStrategy.
......@@ -14,9 +14,9 @@ import theodolite.strategies.restriction.RestrictionStrategy
*/
@RegisterForReflection
class RestrictionSearch(
benchmarkExecutor: BenchmarkExecutor,
private val searchStrategy: SearchStrategy,
private val restrictionStrategies: Set<RestrictionStrategy>
benchmarkExecutor: BenchmarkExecutor,
private val searchStrategy: SearchStrategy,
private val restrictionStrategies: Set<RestrictionStrategy>
) : SearchStrategy(benchmarkExecutor) {
/**
......
package theodolite.strategies.searchstrategy
package rocks.theodolite.core.strategies.searchstrategy
import io.quarkus.runtime.annotations.RegisterForReflection
import theodolite.execution.BenchmarkExecutor
import theodolite.strategies.Metric
import theodolite.util.Results
import rocks.theodolite.core.strategies.Metric
import rocks.theodolite.kubernetes.execution.BenchmarkExecutor
/**
* Base class for the implementation for SearchStrategies. SearchStrategies determine the smallest suitable number
......
package theodolite.util
package rocks.theodolite.core.util
import io.quarkus.runtime.annotations.RegisterForReflection
import theodolite.strategies.Metric
import theodolite.strategies.searchstrategy.SearchStrategy
import rocks.theodolite.core.strategies.Metric
import rocks.theodolite.core.strategies.searchstrategy.SearchStrategy
import rocks.theodolite.kubernetes.util.PatcherDefinition
/**
* Config class that represents a configuration of a theodolite run.
......
package theodolite.util
package rocks.theodolite.core.util
import com.google.gson.GsonBuilder
import mu.KotlinLogging
......
package theodolite.util
package rocks.theodolite.core.util
import io.quarkus.runtime.annotations.RegisterForReflection
import theodolite.strategies.Metric
import rocks.theodolite.core.strategies.Metric
/**
* Central class that saves the state of an execution of Theodolite. For an execution, it is used to save the result of
......
package theodolite.benchmark
package rocks.theodolite.kubernetes.benchmark
import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import io.fabric8.kubernetes.client.NamespacedKubernetesClient
import io.quarkus.runtime.annotations.RegisterForReflection
import theodolite.util.ActionCommandFailedException
import theodolite.util.Configuration
import rocks.theodolite.kubernetes.util.Configuration
import rocks.theodolite.kubernetes.util.exception.ActionCommandFailedException
@JsonDeserialize
@RegisterForReflection
......
package theodolite.benchmark
package rocks.theodolite.kubernetes.benchmark
import io.fabric8.kubernetes.api.model.Status
import io.fabric8.kubernetes.client.KubernetesClientException
......@@ -8,8 +8,8 @@ import io.fabric8.kubernetes.client.dsl.ExecWatch
import io.fabric8.kubernetes.client.utils.Serialization
import mu.KotlinLogging
import okhttp3.Response
import theodolite.util.ActionCommandFailedException
import theodolite.util.Configuration
import rocks.theodolite.kubernetes.util.Configuration
import rocks.theodolite.kubernetes.util.exception.ActionCommandFailedException
import java.io.ByteArrayOutputStream
import java.time.Duration
import java.util.concurrent.CountDownLatch
......@@ -34,10 +34,10 @@ class ActionCommand(val client: NamespacedKubernetesClient) {
* @return the exit code of this executed command
*/
fun exec(
matchLabels: MutableMap<String, String>,
command: Array<String>,
timeout: Long = Configuration.TIMEOUT_SECONDS,
container: String = ""
matchLabels: MutableMap<String, String>,
command: Array<String>,
timeout: Long = Configuration.TIMEOUT_SECONDS,
container: String = ""
): Int {
try {
val execWatch: ExecWatch = if (container.isNotEmpty()) {
......
package theodolite.benchmark
package rocks.theodolite.kubernetes.benchmark
import io.quarkus.runtime.annotations.RegisterForReflection
import theodolite.util.ConfigurationOverride
import theodolite.util.PatcherDefinition
import rocks.theodolite.kubernetes.util.ConfigurationOverride
import rocks.theodolite.kubernetes.util.PatcherDefinition
/**
* A Benchmark contains:
......
package theodolite.benchmark
package rocks.theodolite.kubernetes.benchmark
/**
* A BenchmarkDeployment contains the necessary infrastructure to execute a benchmark.
......
package theodolite.benchmark
package rocks.theodolite.kubernetes.benchmark
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import io.fabric8.kubernetes.api.model.KubernetesResource
import io.quarkus.runtime.annotations.RegisterForReflection
import theodolite.util.ConfigurationOverride
import rocks.theodolite.kubernetes.util.ConfigurationOverride
import kotlin.properties.Delegates
/**
......
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