Skip to content
Snippets Groups Projects
Commit e8fc2ab5 authored by Sören Henning's avatar Sören Henning
Browse files

Add further logging statement regarding SLO checks

parent b5c0e534
No related branches found
No related tags found
3 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
Pipeline #2819 canceled
......@@ -17,8 +17,7 @@ class ExternalSloChecker(
private val externalSlopeURL: String,
private val threshold: Int,
private val warmup: Int
) :
SloChecker {
) : SloChecker {
private val RETRIES = 2
private val TIMEOUT = 60.0
......@@ -38,8 +37,10 @@ class ExternalSloChecker(
*/
override fun evaluate(start: Instant, end: Instant, fetchedData: PrometheusResponse): Boolean {
var counter = 0
val data =
Gson().toJson(mapOf("total_lag" to fetchedData.data?.result, "threshold" to threshold, "warmup" to warmup))
val data = Gson().toJson(mapOf(
"total_lag" to fetchedData.data?.result,
"threshold" to threshold,
"warmup" to warmup))
while (counter < RETRIES) {
val result = post(externalSlopeURL, data = data, timeout = TIMEOUT)
......@@ -47,7 +48,9 @@ class ExternalSloChecker(
counter++
logger.error { "Could not reach external slope analysis" }
} else {
return result.text.toBoolean()
val booleanResult = result.text.toBoolean()
logger.info { "SLO checker result is: $booleanResult" }
return booleanResult
}
}
......
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