Skip to content
Snippets Groups Projects
Commit e1dbf940 authored by Lorenz Boguhn's avatar Lorenz Boguhn
Browse files

Fix kdoc

parent f8c0b74e
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!112Add Kdoc,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
Showing
with 35 additions and 29 deletions
...@@ -13,14 +13,14 @@ import kotlin.properties.Delegates ...@@ -13,14 +13,14 @@ import kotlin.properties.Delegates
* An example for this is the BenchmarkExecution.yaml * An example for this is the BenchmarkExecution.yaml
* A BenchmarkExecution consists of: * A BenchmarkExecution consists of:
* - A [name]. * - A [name].
* - The [benchmark] (a BenchmarkType) that should be executed. * - The [benchmark] that should be executed.
* - The [load] that should be checked in the benchmark. * - The [load] that should be checked in the benchmark.
* - The [resources] that should be checked in the benchmark. * - The [resources] that should be checked in the benchmark.
* - A List of [slos] that are used for the evaluation of the experiments * - A list of [slos] that are used for the evaluation of the experiments.
* - An [execution] that encapsulates: the strategy, the duration, and the restrictions * - An [execution] that encapsulates: the strategy, the duration, and the restrictions
* for the execution of the benchmark. * for the execution of the benchmark.
* - [configOverrides] additional configurations. * - [configOverrides] additional configurations.
* This class is used for the parsing(in the [theodolite.execution.TheodoliteYamlExecutor]) and * This class is used for parsing(in [theodolite.execution.TheodoliteYamlExecutor]) and
* for the deserializing in the [theodolite.execution.operator.TheodoliteOperator]. * for the deserializing in the [theodolite.execution.operator.TheodoliteOperator].
* @constructor construct an empty BenchmarkExecution. * @constructor construct an empty BenchmarkExecution.
*/ */
...@@ -50,10 +50,12 @@ class BenchmarkExecution : CustomResource(), Namespaced { ...@@ -50,10 +50,12 @@ class BenchmarkExecution : CustomResource(), Namespaced {
/** /**
* Measurable metric. * Measurable metric.
* [sloType] determines the type of the metric.
* It is evaluated using the [theodolite.evaluation.ExternalSloChecker] by data measured by Prometheus. * It is evaluated using the [theodolite.evaluation.ExternalSloChecker] by data measured by Prometheus.
* The evaluation checks if a [threshold] is reached or not. * The evaluation checks if a [threshold] is reached or not.
* It has a [offset] by which the start and end points of the Metric can be shifted. * [offset] determines the shift in hours by which the start and end timestamps should be shifted.
* The [warmup] determines after which time the metric should be evaluated to avoid starting interferences. * The [warmup] determines after which time the metric should be evaluated to avoid starting interferences.
* The [warmup] time unit depends on the Slo: for the lag trend it is in seconds.
*/ */
@JsonDeserialize @JsonDeserialize
@RegisterForReflection @RegisterForReflection
......
...@@ -40,7 +40,7 @@ class KubernetesBenchmarkDeployment( ...@@ -40,7 +40,7 @@ class KubernetesBenchmarkDeployment(
} }
/** /**
* Tears a [KubernetesBenchmark] down: * Tears down a [KubernetesBenchmark]:
* - Reset the Kafka Lag Exporter. * - Reset the Kafka Lag Exporter.
* - Remove the used topics. * - Remove the used topics.
* - Remove the [KubernetesResource]s. * - Remove the [KubernetesResource]s.
......
...@@ -14,7 +14,7 @@ private val logger = KotlinLogging.logger {} ...@@ -14,7 +14,7 @@ private val logger = KotlinLogging.logger {}
class CsvExporter { class CsvExporter {
/** /**
* Uses the [PrintWriter] to transform a [PrometheusResponse] to a Csv file. * Uses the [PrintWriter] to transform a [PrometheusResponse] to a CSV file.
* @param name of the file. * @param name of the file.
* @param prom Response that is documented. * @param prom Response that is documented.
* *
...@@ -33,7 +33,7 @@ class CsvExporter { ...@@ -33,7 +33,7 @@ class CsvExporter {
} }
/** /**
* Converts a [PrometheusResponse] into a [List] of [List] of [String]s * Converts a [PrometheusResponse] into a [List] of [List]s of [String]s
*/ */
private fun promResponseToList(prom: PrometheusResponse): List<List<String>> { private fun promResponseToList(prom: PrometheusResponse): List<List<String>> {
val name = prom.data?.result?.get(0)?.metric?.group.toString() val name = prom.data?.result?.get(0)?.metric?.group.toString()
......
...@@ -23,7 +23,7 @@ class TheodoliteExecutor( ...@@ -23,7 +23,7 @@ class TheodoliteExecutor(
private val kubernetesBenchmark: KubernetesBenchmark private val kubernetesBenchmark: KubernetesBenchmark
) { ) {
/** /**
* A executor object, configured with the specified benchmark, evaluation method, experiment duration * An executor object, configured with the specified benchmark, evaluation method, experiment duration
* and overrides which are given in the execution. * and overrides which are given in the execution.
*/ */
lateinit var executor: BenchmarkExecutor lateinit var executor: BenchmarkExecutor
...@@ -31,8 +31,9 @@ class TheodoliteExecutor( ...@@ -31,8 +31,9 @@ class TheodoliteExecutor(
/** /**
* Creates all required components to start Theodolite. * Creates all required components to start Theodolite.
* *
* @return a configuration object that contains the loads, the resources and the compositeStrategy. * @return a [Config], that contains a list of [LoadDimension]s,
* The compositeStrategy is configured and able to find the minimum required resource for the given load. * a list of [Resource]s , and the [CompositeStrategy].
* The [CompositeStrategy] is configured and able to find the minimum required resource for the given load.
*/ */
private fun buildConfig(): Config { private fun buildConfig(): Config {
val results = Results() val results = Results()
......
...@@ -79,7 +79,7 @@ class K8sResourceLoader(private val client: NamespacedKubernetesClient) { ...@@ -79,7 +79,7 @@ class K8sResourceLoader(private val client: NamespacedKubernetesClient) {
/** /**
* Factory function used to load different k8s resources from a path. * Factory function used to load different k8s resources from a path.
* Supported kinds are: deployments,Services, ServiceMonitors,ConfigMaps and CustomResources. * Supported kinds are: Deployments, Services, ServiceMonitors, ConfigMaps and CustomResources.
* Uses CustomResource as default if Kind is not supported. * Uses CustomResource as default if Kind is not supported.
* @param kind of the resource. CustomResource as default. * @param kind of the resource. CustomResource as default.
* @param path of the resource to be loaded. * @param path of the resource to be loaded.
......
...@@ -5,7 +5,7 @@ import io.fabric8.kubernetes.api.model.KubernetesResource ...@@ -5,7 +5,7 @@ import io.fabric8.kubernetes.api.model.KubernetesResource
/** /**
* A Patcher is able to modify values of a Kubernetes resource, see [Patcher]. * A Patcher is able to modify values of a Kubernetes resource, see [Patcher].
* *
* A AbstractPatcher is created with up to three parameters. * An AbstractPatcher is created with up to three parameters.
* *
* @param k8sResource The Kubernetes resource to be patched. * @param k8sResource The Kubernetes resource to be patched.
* @param container *(optional)* The name of the container to be patched * @param container *(optional)* The name of the container to be patched
......
...@@ -5,14 +5,14 @@ import io.fabric8.kubernetes.api.model.apps.Deployment ...@@ -5,14 +5,14 @@ import io.fabric8.kubernetes.api.model.apps.Deployment
import io.fabric8.kubernetes.api.model.apps.StatefulSet import io.fabric8.kubernetes.api.model.apps.StatefulSet
/** /**
* The Image patcher make it possible the change the image of a container * The Image patcher allows to change the image of a container.
* *
* @param k8sResource Kubernetes resource to be patched. * @param k8sResource Kubernetes resource to be patched.
* @param container Container to be patched. * @param container Container to be patched.
*/ */
class ImagePatcher(private val k8sResource: KubernetesResource, private val container: String) : class ImagePatcher(private val k8sResource: KubernetesResource, private val container: String) :
AbstractPatcher(k8sResource, container) { AbstractPatcher(k8sResource, container) {
override fun <String> patch(imagePath: String) { override fun <String> patch(imagePath: String) {
if (k8sResource is Deployment) { if (k8sResource is Deployment) {
k8sResource.spec.template.spec.containers.filter { it.name == container }.forEach { k8sResource.spec.template.spec.containers.filter { it.name == container }.forEach {
......
...@@ -4,9 +4,9 @@ import theodolite.util.PatcherDefinition ...@@ -4,9 +4,9 @@ import theodolite.util.PatcherDefinition
import theodolite.util.TypeName import theodolite.util.TypeName
/** /**
* The PatcherDefinition Factory creates a PatcherDefinitions, see [PatcherDefinition] * The PatcherDefinition Factory creates a [PatcherDefinition]s.
* *
* @constructor Create empty Patcher definition factory * @constructor Create empty Patcher definition factory.
*/ */
class PatcherDefinitionFactory { class PatcherDefinitionFactory {
/** /**
...@@ -20,7 +20,7 @@ class PatcherDefinitionFactory { ...@@ -20,7 +20,7 @@ class PatcherDefinitionFactory {
* @return A list of PatcherDefinitions which corresponds to the * @return A list of PatcherDefinitions which corresponds to the
* value of the requiredType. * value of the requiredType.
*/ */
fun createPatcherDefinition(requiredType: String, patcherTypes: List<TypeName>) : List<PatcherDefinition> { fun createPatcherDefinition(requiredType: String, patcherTypes: List<TypeName>): List<PatcherDefinition> {
return patcherTypes return patcherTypes
.filter { type -> type.typeName == requiredType } .filter { type -> type.typeName == requiredType }
.flatMap { type -> type.patchers } .flatMap { type -> type.patchers }
......
...@@ -6,23 +6,26 @@ import theodolite.util.PatcherDefinition ...@@ -6,23 +6,26 @@ import theodolite.util.PatcherDefinition
/** /**
* The Patcher factory creates [Patcher]s * The Patcher factory creates [Patcher]s
* *
* @constructor Create empty Patcher factory * @constructor Creates an empty PatcherFactory.
*/ */
class PatcherFactory { class PatcherFactory {
/** /**
* Create patcher a patcher based on the given PatcherDefinition and * Create patcher based on the given [PatcherDefinition] and
* the list of KubernetesResources. * the list of KubernetesResources.
* *
* @param patcherDefinition The PatcherDefinition for which are * @param patcherDefinition The [PatcherDefinition] for which are
* Patcher should be created * [Patcher] should be created.
* @param k8sResources List of all available Kubernetes resources. * @param k8sResources List of all available Kubernetes resources.
* This is a list of pairs<String, KubernetesResource>. * This is a list of pairs<String, KubernetesResource>:
* The string corresponds to the filename where * The frist corresponds to the filename where the resource is defined.
* the Kubernetes resources were defined. * The second corresponds to the concrete [KubernetesResource] that should be patched.
* @return The created Patcher, throws `IllegalArgumentException` if no patcher can be created. * @return The created [Patcher].
* @throws IllegalArgumentException if no patcher can be created.
*/ */
fun createPatcher(patcherDefinition: PatcherDefinition, fun createPatcher(
k8sResources: List<Pair<String, KubernetesResource>>) : Patcher { patcherDefinition: PatcherDefinition,
k8sResources: List<Pair<String, KubernetesResource>>
): Patcher {
val resource = val resource =
k8sResources.filter { it.first == patcherDefinition.resource }.map { resource -> resource.second }[0] k8sResources.filter { it.first == patcherDefinition.resource }.map { resource -> resource.second }[0]
return when (patcherDefinition.type) { return when (patcherDefinition.type) {
...@@ -43,4 +46,4 @@ class PatcherFactory { ...@@ -43,4 +46,4 @@ class PatcherFactory {
else -> throw IllegalArgumentException("Patcher type ${patcherDefinition.type} not found") else -> throw IllegalArgumentException("Patcher type ${patcherDefinition.type} not found")
} }
} }
} }
\ No newline at end of file
package theodolite.util package theodolite.util
/** /**
* Interface for parsing files. * Interface for parsers.
*/ */
interface Parser { interface Parser {
/** /**
......
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