Skip to content
Snippets Groups Projects
Commit c278cbb0 authored by Benedikt Wetzel's avatar Benedikt Wetzel Committed by Lorenz Boguhn
Browse files

Add todods/notes

parent 4151af82
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!92Introduce experiment evaluation,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
......@@ -13,7 +13,9 @@ private val logger = KotlinLogging.logger {}
class MetricFetcher(private val prometheusURL: String) {
// Instant
fun fetchMetric(start: Long, end: Long, query: String): PrometheusResponse {
// TODO handle timeouts
var trys = 0
val parameter = mapOf(
"query" to query,
......@@ -40,6 +42,7 @@ class MetricFetcher(private val prometheusURL: String) {
throw ConnectException("No answer from Prometheus received")
}
// TODO required?
private fun toISODate(timestamp: Long): String {
val sdf = java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.sss'Z'")
val date = Date(timestamp - (3600 * 1000))//subtract 1h since cluster is in another timezone
......
......@@ -9,10 +9,11 @@ class SLOCheckerImpl(private val prometheusURL: String) : SLOChecker {
override fun evaluate(start: Long, end: Long): Boolean {
var counter = 0
val metricFetcher = MetricFetcher(prometheusURL = prometheusURL)
val fetchedData = metricFetcher.fetchMetric(start, end, "sum by(group)(kafka_consumergroup_group_lag > 0)")
val fetchedData = metricFetcher.fetchMetric(start, end, "sum by(group)(kafka_consumergroup_group_lag >= 0)")
val data = JSONObject(mapOf("total_lag" to fetchedData.data?.result))
while (counter < 2) {
// TODO handle timeouts
val result = post("http://127.0.0.1:8000/evaluate-slope", data = data)
if (result.statusCode != 200) {
counter++
......
......@@ -23,8 +23,8 @@ class BenchmarkExecutorImpl(
benchmarkDeployment.teardown()
// todo evaluate
val result = SLOCheckerImpl("http://localhost:32656")
.evaluate( //TODO FIX HERE
Instant.now().toEpochMilli() - executionDuration.toMillis(),
.evaluate( //TODO FIX HERE, catch exception -> return false
Instant.now().toEpochMilli() - executionDuration.toMillis(), // TODO instant.minus(duration)
Instant.now().toEpochMilli()
)
this.results.setResult(Pair(load, res), result)
......
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