diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/CsvExporter.kt b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/CsvExporter.kt index 516f17a45327edc890533d3f236d41a173623678..e2f536af6dba838b2b4027d6cfafb032ebd3d04d 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/CsvExporter.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/CsvExporter.kt @@ -4,6 +4,7 @@ import mu.KotlinLogging import theodolite.util.PrometheusResponse import java.io.File import java.io.PrintWriter +import java.util.* private val logger = KotlinLogging.logger {} @@ -13,7 +14,7 @@ class CsvExporter { * Uses the PrintWriter to transform a PrometheusResponse to Csv */ fun toCsv(name: String, prom: PrometheusResponse) { - val responseArray = toArray(prom) + val responseArray = promResponseToList(prom) val csvOutputFile = File("$name.csv") PrintWriter(csvOutputFile).use { pw -> @@ -22,14 +23,13 @@ class CsvExporter { pw.println(it.joinToString()) } } - logger.debug { csvOutputFile.absolutePath } logger.info { "Wrote csv file: $name to ${csvOutputFile.absolutePath}" } } /** * Converts a PrometheusResponse into a List of List of Strings */ - private fun toArray(prom: PrometheusResponse): MutableList<List<String>> { + private fun promResponseToList(prom: PrometheusResponse): List<List<String>> { val name = prom.data?.result?.get(0)?.metric?.group.toString() val values = prom.data?.result?.get(0)?.values val dataList = mutableListOf<List<String>>() @@ -40,6 +40,6 @@ class CsvExporter { dataList.add(listOf(name, "${y[0]}", "${y[1]}")) } } - return dataList + return Collections.unmodifiableList(dataList) } } diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/ExternalSloChecker.kt b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/ExternalSloChecker.kt index bc9ca12cb78d64cfa3661d64b9d7d6859c2c4fbc..e65116c0a6b562c0e05714d09ab5a9b528249a05 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/ExternalSloChecker.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/ExternalSloChecker.kt @@ -5,7 +5,6 @@ import khttp.post import mu.KotlinLogging import theodolite.util.PrometheusResponse import java.net.ConnectException -import java.time.Duration import java.time.Instant class ExternalSloChecker( @@ -29,7 +28,7 @@ class ExternalSloChecker( val result = post(externalSlopeURL, data = data, timeout = TIMEOUT) if (result.statusCode != 200) { counter++ - logger.error{"Could not reach external slope analysis"} + logger.error { "Could not reach external slope analysis" } } else { return result.text.toBoolean() }