From e1dbf94008b525403f425eeae967da5adbcafd4c Mon Sep 17 00:00:00 2001 From: lorenz <stu203404@mail.uni-kiel.de> Date: Tue, 13 Apr 2021 17:04:27 +0200 Subject: [PATCH] Fix kdoc --- .../benchmark/BenchmarkExecution.kt | 10 +++++--- .../KubernetesBenchmarkDeployment.kt | 2 +- .../theodolite/evaluation/CsvExporter.kt | 4 +-- .../execution/TheodoliteExecutor.kt | 7 +++--- .../theodolite/k8s/K8sResourceLoader.kt | 2 +- .../theodolite/patcher/AbstractPatcher.kt | 2 +- .../kotlin/theodolite/patcher/ImagePatcher.kt | 4 +-- .../patcher/PatcherDefinitionFactory.kt | 6 ++--- .../theodolite/patcher/PatcherFactory.kt | 25 +++++++++++-------- .../src/main/kotlin/theodolite/util/Parser.kt | 2 +- 10 files changed, 35 insertions(+), 29 deletions(-) diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt index 3e2a3bcd0..5e949e01a 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt @@ -13,14 +13,14 @@ import kotlin.properties.Delegates * An example for this is the BenchmarkExecution.yaml * A BenchmarkExecution consists of: * - 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 [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 * for the execution of the benchmark. * - [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]. * @constructor construct an empty BenchmarkExecution. */ @@ -50,10 +50,12 @@ class BenchmarkExecution : CustomResource(), Namespaced { /** * Measurable metric. + * [sloType] determines the type of the metric. * It is evaluated using the [theodolite.evaluation.ExternalSloChecker] by data measured by Prometheus. * 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] time unit depends on the Slo: for the lag trend it is in seconds. */ @JsonDeserialize @RegisterForReflection diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt index 76ba76e57..3d73dd67d 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt @@ -40,7 +40,7 @@ class KubernetesBenchmarkDeployment( } /** - * Tears a [KubernetesBenchmark] down: + * Tears down a [KubernetesBenchmark]: * - Reset the Kafka Lag Exporter. * - Remove the used topics. * - Remove the [KubernetesResource]s. diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/CsvExporter.kt b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/CsvExporter.kt index c80798e55..688628515 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/CsvExporter.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/CsvExporter.kt @@ -14,7 +14,7 @@ private val logger = KotlinLogging.logger {} 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 prom Response that is documented. * @@ -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>> { val name = prom.data?.result?.get(0)?.metric?.group.toString() diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt index 1967ad814..527ae4d58 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt @@ -23,7 +23,7 @@ class TheodoliteExecutor( 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. */ lateinit var executor: BenchmarkExecutor @@ -31,8 +31,9 @@ class TheodoliteExecutor( /** * Creates all required components to start Theodolite. * - * @return a configuration object that contains the loads, the resources and the compositeStrategy. - * The compositeStrategy is configured and able to find the minimum required resource for the given load. + * @return a [Config], that contains a list of [LoadDimension]s, + * 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 { val results = Results() diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/k8s/K8sResourceLoader.kt b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/K8sResourceLoader.kt index 054653928..a374e97f6 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/k8s/K8sResourceLoader.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/K8sResourceLoader.kt @@ -79,7 +79,7 @@ class K8sResourceLoader(private val client: NamespacedKubernetesClient) { /** * 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. * @param kind of the resource. CustomResource as default. * @param path of the resource to be loaded. diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/patcher/AbstractPatcher.kt b/theodolite-quarkus/src/main/kotlin/theodolite/patcher/AbstractPatcher.kt index ee9238d76..a1a4501c9 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/patcher/AbstractPatcher.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/patcher/AbstractPatcher.kt @@ -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 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 container *(optional)* The name of the container to be patched diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/patcher/ImagePatcher.kt b/theodolite-quarkus/src/main/kotlin/theodolite/patcher/ImagePatcher.kt index a283e424e..e5e5f6cb6 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/patcher/ImagePatcher.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/patcher/ImagePatcher.kt @@ -5,14 +5,14 @@ import io.fabric8.kubernetes.api.model.apps.Deployment 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 container Container to be patched. */ class ImagePatcher(private val k8sResource: KubernetesResource, private val container: String) : AbstractPatcher(k8sResource, container) { - + override fun <String> patch(imagePath: String) { if (k8sResource is Deployment) { k8sResource.spec.template.spec.containers.filter { it.name == container }.forEach { diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/patcher/PatcherDefinitionFactory.kt b/theodolite-quarkus/src/main/kotlin/theodolite/patcher/PatcherDefinitionFactory.kt index c46af79dc..bcb568f71 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/patcher/PatcherDefinitionFactory.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/patcher/PatcherDefinitionFactory.kt @@ -4,9 +4,9 @@ import theodolite.util.PatcherDefinition 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 { /** @@ -20,7 +20,7 @@ class PatcherDefinitionFactory { * @return A list of PatcherDefinitions which corresponds to the * value of the requiredType. */ - fun createPatcherDefinition(requiredType: String, patcherTypes: List<TypeName>) : List<PatcherDefinition> { + fun createPatcherDefinition(requiredType: String, patcherTypes: List<TypeName>): List<PatcherDefinition> { return patcherTypes .filter { type -> type.typeName == requiredType } .flatMap { type -> type.patchers } diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/patcher/PatcherFactory.kt b/theodolite-quarkus/src/main/kotlin/theodolite/patcher/PatcherFactory.kt index bf7628d63..5b1274ea6 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/patcher/PatcherFactory.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/patcher/PatcherFactory.kt @@ -6,23 +6,26 @@ import theodolite.util.PatcherDefinition /** * The Patcher factory creates [Patcher]s * - * @constructor Create empty Patcher factory + * @constructor Creates an empty 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. * - * @param patcherDefinition The PatcherDefinition for which are - * Patcher should be created + * @param patcherDefinition The [PatcherDefinition] for which are + * [Patcher] should be created. * @param k8sResources List of all available Kubernetes resources. - * This is a list of pairs<String, KubernetesResource>. - * The string corresponds to the filename where - * the Kubernetes resources were defined. - * @return The created Patcher, throws `IllegalArgumentException` if no patcher can be created. + * This is a list of pairs<String, KubernetesResource>: + * The frist corresponds to the filename where the resource is defined. + * The second corresponds to the concrete [KubernetesResource] that should be patched. + * @return The created [Patcher]. + * @throws IllegalArgumentException if no patcher can be created. */ - fun createPatcher(patcherDefinition: PatcherDefinition, - k8sResources: List<Pair<String, KubernetesResource>>) : Patcher { + fun createPatcher( + patcherDefinition: PatcherDefinition, + k8sResources: List<Pair<String, KubernetesResource>> + ): Patcher { val resource = k8sResources.filter { it.first == patcherDefinition.resource }.map { resource -> resource.second }[0] return when (patcherDefinition.type) { @@ -43,4 +46,4 @@ class PatcherFactory { else -> throw IllegalArgumentException("Patcher type ${patcherDefinition.type} not found") } } -} \ No newline at end of file +} diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/Parser.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/Parser.kt index 273eedfab..a5734b5ed 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/util/Parser.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/Parser.kt @@ -1,7 +1,7 @@ package theodolite.util /** - * Interface for parsing files. + * Interface for parsers. */ interface Parser { /** -- GitLab