From 689c93487fdac5bbb559b7830e0f9b0ff1b74f4a Mon Sep 17 00:00:00 2001
From: Simon Ehrenstein <simon.ehrenstein@gmail.com>
Date: Mon, 12 Apr 2021 13:13:08 +0200
Subject: [PATCH] Format kDoc

---
 .../benchmark/BenchmarkDeployment.kt          |  6 +++---
 .../benchmark/BenchmarkExecution.kt           | 14 ++++++-------
 .../benchmark/KafkaLagExporterRemover.kt      |  4 ++--
 .../benchmark/KubernetesBenchmark.kt          | 10 +++++-----
 .../KubernetesBenchmarkDeployment.kt          |  4 ++--
 .../theodolite/evaluation/AnalysisExecutor.kt | 12 +++++------
 .../theodolite/evaluation/CsvExporter.kt      |  4 ++--
 .../evaluation/ExternalSloChecker.kt          |  6 +++---
 .../theodolite/evaluation/MetricFetcher.kt    | 18 ++++++++---------
 .../theodolite/evaluation/SloChecker.kt       |  2 +-
 .../evaluation/SloCheckerFactory.kt           | 20 +++++++++----------
 11 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkDeployment.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkDeployment.kt
index 0f2019931..92d3f7a01 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkDeployment.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkDeployment.kt
@@ -1,19 +1,19 @@
 package theodolite.benchmark
 
 /**
- *  A BenchmarkDeployment contains the necessary infrastructure to execute a Benchmark.
+ *  A BenchmarkDeployment contains the necessary infrastructure to execute a benchmark.
  *  Therefore it has the capabilities to set up the deployment of a benchmark and to tear it down.
  */
 interface BenchmarkDeployment {
 
     /**
-     * Setup a Benchmark. This method is responsible for deploying the resources
+     * Setup a benchmark. This method is responsible for deploying the resources
      * and organize the needed infrastructure.
      */
     fun setup()
 
     /**
-     *  Tears a Benchmark down. This method is responsible for deleting the deployed
+     *  Tears down a benchmark. This method is responsible for deleting the deployed
      *  resources and to reset the used infrastructure.
      */
     fun teardown()
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt
index 416712304..3e2a3bcd0 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt
@@ -9,19 +9,19 @@ import theodolite.util.ConfigurationOverride
 import kotlin.properties.Delegates
 
 /**
- * This Class represents the configuration for an Execution of a Benchmark.
+ * This class represents the configuration for an execution of a benchmark.
  * An example for this is the BenchmarkExecution.yaml
  * A BenchmarkExecution consists of:
  *  - A [name].
  *  - The [benchmark] (a BenchmarkType) that should be executed.
- *  - The [laod] 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.
  *  - A List of [slos] that are used for the evaluation of the experiments
- *  - An [execution] that encapsulates: the [strategy], the [duration], the [repetitions], and the [restrictions]
+ *  - 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 [TheodoliteYamlExecutor]) and
- *  for the deserializing in the [TheodoliteOperator].
+ *  This class is used for the parsing(in the [theodolite.execution.TheodoliteYamlExecutor]) and
+ *  for the deserializing in the [theodolite.execution.operator.TheodoliteOperator].
  *  @constructor construct an empty BenchmarkExecution.
  */
 @JsonDeserialize
@@ -49,8 +49,8 @@ class BenchmarkExecution : CustomResource(), Namespaced {
     }
 
     /**
-     * Measurable Metric.
-     * It is evaluated using the [ExternalSloChecker] by data measured by Prometheus.
+     * Measurable 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.
      * The [warmup] determines after which time the metric should be evaluated to avoid starting interferences.
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KafkaLagExporterRemover.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KafkaLagExporterRemover.kt
index 52dde8594..e8179b42d 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KafkaLagExporterRemover.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KafkaLagExporterRemover.kt
@@ -7,13 +7,13 @@ private val logger = KotlinLogging.logger {}
 
 /**
  * Used to reset the KafkaLagExporter by deleting the pod.
- * @param client KubernetesClient used for the deletion.
+ * @param client NamespacedKubernetesClient used for the deletion.
  */
 class KafkaLagExporterRemover(private val client: NamespacedKubernetesClient) {
 
     /**
      * Deletes all pods with the selected label.
-     * @param label of the pod that should be deleted.
+     * @param [label] of the pod that should be deleted.
      */
     fun remove(label: String) {
         this.client.pods().withLabel(label).delete()
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt
index 08a81975f..f129b6bf5 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt
@@ -15,7 +15,7 @@ private val logger = KotlinLogging.logger {}
 private var DEFAULT_NAMESPACE = "default"
 
 /**
- * Represents a Benchmark in Kubernetes. An example for this is the BenchmarkType.yaml
+ * Represents a benchmark in Kubernetes. An example for this is the BenchmarkType.yaml
  * Contains a of:
  * - [name] of the benchmark,
  * - [appResource] list of the resources that have to be deployed for the benchmark,
@@ -26,8 +26,8 @@ private var DEFAULT_NAMESPACE = "default"
  * - [namespace] for the client,
  * - [path] under which the resource yamls can be found.
  *
- *  This class is used for the parsing(in the [TheodoliteYamlExecutor]) and
- *  for the deserializing in the [TheodoliteOperator].
+ *  This class is used for the parsing(in the [theodolite.execution.TheodoliteYamlExecutor]) and
+ *  for the deserializing in the [theodolite.execution.operator.TheodoliteOperator].
  * @constructor construct an empty Benchmark.
  */
 @RegisterForReflection
@@ -42,7 +42,7 @@ class KubernetesBenchmark : Benchmark, CustomResource(), Namespaced {
     lateinit var path: String
 
     /**
-     * Loads KubernetsResources.
+     * Loads [KubernetesResource]s.
      * It first loads them via the [YamlParser] to check for their concrete type and afterwards initializes them using
      * the [K8sResourceLoader]
      */
@@ -67,7 +67,7 @@ class KubernetesBenchmark : Benchmark, CustomResource(), Namespaced {
     }
 
     /**
-     * Builds a Deployment.
+     * Builds a deployment.
      * First loads all required resources and then patches them to the concrete load and resources for the experiment.
      * Afterwards patches additional configurations(cluster depending) into the resources.
      * @param load concrete load that will be benchmarked in this experiment.
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt
index 506c8eb59..c26555e6f 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt
@@ -43,9 +43,9 @@ class KubernetesBenchmarkDeployment(
 
     /**
      * Tears a [KubernetesBenchmark] down:
-     *  - Reset the KafkaLagExporter.
+     *  - Reset the Kafka Lag Exporter.
      *  - Remove the used topics.
-     *  - Remove the KubernetesResources.
+     *  - Remove the [KubernetesResource]s.
      */
     override fun teardown() {
         KafkaLagExporterRemover(client).remove(LABEL)
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/AnalysisExecutor.kt b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/AnalysisExecutor.kt
index 767eb205d..71fe00be0 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/AnalysisExecutor.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/AnalysisExecutor.kt
@@ -11,7 +11,7 @@ private val logger = KotlinLogging.logger {}
 
 /**
  * Contains the analysis. Fetches a metric from Prometheus, documents it, and evaluates it.
- * @param slo that is used for the analysis.
+ * @param slo Slo that is used for the analysis.
  */
 class AnalysisExecutor(private val slo: BenchmarkExecution.Slo) {
     private val fetcher = MetricFetcher(
@@ -22,10 +22,10 @@ class AnalysisExecutor(private val slo: BenchmarkExecution.Slo) {
     /**
      *  Analyses an experiment via prometheus data.
      *  First fetches data from prometheus, then documents them and afterwards evaluate it via a [slo].
-     *  @param load [LoadDimension] of the experiment.
-     *  @param res [Resource] of the experiment.
-     *  @param executionDuration [Duration] of the experiment.
-     *  @return [true] if the experiment succeeded.
+     *  @param load of the experiment.
+     *  @param res of the experiment.
+     *  @param executionDuration of the experiment.
+     *  @return true if the experiment succeeded.
      */
     fun analyze(load: LoadDimension, res: Resource, executionDuration: Duration): Boolean {
         var result = false
@@ -40,7 +40,7 @@ class AnalysisExecutor(private val slo: BenchmarkExecution.Slo) {
             CsvExporter().toCsv(name = "${load.get()}_${res.get()}_${slo.sloType}", prom = prometheusData)
 
             val sloChecker = SloCheckerFactory().create(
-                slotype = slo.sloType,
+                sloType = slo.sloType,
                 externalSlopeURL = slo.externalSloUrl,
                 threshold = slo.threshold,
                 warmup = slo.warmup
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/CsvExporter.kt b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/CsvExporter.kt
index fd82a5fcc..c80798e55 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 Strings
+     * Converts a [PrometheusResponse] into a [List] of [List] 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/evaluation/ExternalSloChecker.kt b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/ExternalSloChecker.kt
index ced10ccce..fd901abc4 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/ExternalSloChecker.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/ExternalSloChecker.kt
@@ -8,9 +8,9 @@ import java.net.ConnectException
 import java.time.Instant
 
 /**
- * SloChecker that uses an external source for the concrete evaluation.
+ * [SloChecker] that uses an external source for the concrete evaluation.
  * @param externalSlopeURL The url under which the external evaluation can be reached.
- * @param threshold threshold that should not be ... to evaluate to true.
+ * @param threshold threshold that should not be exceeded to evaluate to true.
  * @param warmup time that is not taken into consideration for the evaluation.
  */
 class ExternalSloChecker(
@@ -33,7 +33,7 @@ class ExternalSloChecker(
      * @param start point of the experiment.
      * @param end point of the experiment.
      * @param fetchedData that should be evaluated
-     * @return [true] if the expirment was successful(the threshold was not exceeded.
+     * @return true if the experiment was successful(the threshold was not exceeded.
      * @throws ConnectException if the external service could not be reached.
      */
     override fun evaluate(start: Instant, end: Instant, fetchedData: PrometheusResponse): Boolean {
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/MetricFetcher.kt b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/MetricFetcher.kt
index c8b4d5b85..bbfbf8c32 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/MetricFetcher.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/MetricFetcher.kt
@@ -12,9 +12,9 @@ import java.time.Instant
 private val logger = KotlinLogging.logger {}
 
 /**
- * Used to fetch Metrics from Prometheus.
- * @param prometheusURL - URL to the Prometheus server.
- * @param offset - Duration of time that the start and end points of the queries
+ * Used to fetch metrics from Prometheus.
+ * @param prometheusURL URL to the Prometheus server.
+ * @param offset Duration of time that the start and end points of the queries
  * should be shifted. (for different timezones, etc..)
  */
 class MetricFetcher(private val prometheusURL: String, private val offset: Duration) {
@@ -22,13 +22,13 @@ class MetricFetcher(private val prometheusURL: String, private val offset: Durat
     private val TIMEOUT = 60.0
 
     /**
-     * Tries to fetch a metric by a query to a PrometheusServer.
+     * Tries to fetch a metric by a query to a Prometheus server.
      * Retries to fetch the metric [RETRIES] times.
      * Connects to the server via [prometheusURL].
      *
-     * @param start - start point of the query.
-     * @param end - end point of the query.
-     * @param query -  query for the prometheus server.
+     * @param start start point of the query.
+     * @param end end point of the query.
+     * @param query query for the prometheus server.
      * @throws ConnectException - if the prometheus server timed out/was not reached.
      */
     fun fetchMetric(start: Instant, end: Instant, query: String): PrometheusResponse {
@@ -64,8 +64,8 @@ class MetricFetcher(private val prometheusURL: String, private val offset: Durat
 
     /**
      * Deserializes a response from Prometheus.
-     * @param values - Response from Prometheus.
-     * @return a PrometheusResponse.
+     * @param values Response from Prometheus.
+     * @return a [PrometheusResponse]
      */
     private fun parseValues(values: Response): PrometheusResponse {
         return Gson().fromJson<PrometheusResponse>(
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/SloChecker.kt b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/SloChecker.kt
index 21d3c972c..94d816d87 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/SloChecker.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/SloChecker.kt
@@ -16,7 +16,7 @@ interface SloChecker {
      * @param start of the experiment
      * @param end of the experiment
      * @param fetchedData from Prometheus that will be evaluated.
-     * @return [true] if experiment was successful. Otherwise [false].
+     * @return true if experiment was successful. Otherwise false.
      */
     fun evaluate(start: Instant, end: Instant, fetchedData: PrometheusResponse): Boolean
 }
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt
index eb0f58ae6..20c421acd 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt
@@ -1,7 +1,7 @@
 package theodolite.evaluation
 
 /**
- * Factory used to potentially create different SloCheckers.
+ * Factory used to potentially create different [SloChecker]s.
  * Supports: lag type.
  */
 class SloCheckerFactory {
@@ -10,27 +10,27 @@ class SloCheckerFactory {
      * Creates different [SloChecker]s.
      * Supports: lag type.
      *
-     * @param slotype Type of the SloChecker.
-     * @param externalSlopeURL Url to the concrete SlopeChecker.
-     * @param threshold for the SloChecker.
-     * @param warmup for the sloChecker.
+     * @param sloType Type of the [SloChecker].
+     * @param externalSlopeURL Url to the concrete [SloChecker].
+     * @param threshold for the [SloChecker].
+     * @param warmup for the [SloChecker].
      *
-     * @return A SloChecker
-     * @throws IllegalArgumentException If sloType not supported.
+     * @return A [SloChecker]
+     * @throws IllegalArgumentException If [sloType] not supported.
      */
     fun create(
-        slotype: String,
+        sloType: String,
         externalSlopeURL: String,
         threshold: Int,
         warmup: Int
     ): SloChecker {
-        return when (slotype) {
+        return when (sloType) {
             "lag trend" -> ExternalSloChecker(
                 externalSlopeURL = externalSlopeURL,
                 threshold = threshold,
                 warmup = warmup
             )
-            else -> throw IllegalArgumentException("Slotype $slotype not found.")
+            else -> throw IllegalArgumentException("Slotype $sloType not found.")
         }
     }
 }
-- 
GitLab