Skip to content
Snippets Groups Projects
Commit 4fa8de25 authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

clean up

parent 98edf33f
No related branches found
No related tags found
1 merge request!180Make the analysis of experiments more flexible
...@@ -36,7 +36,6 @@ class AnalysisExecutor( ...@@ -36,7 +36,6 @@ class AnalysisExecutor(
* @return true if the experiment succeeded. * @return true if the experiment succeeded.
*/ */
fun analyze(load: LoadDimension, res: Resource, executionIntervals: List<Pair<Instant, Instant>>): Boolean { fun analyze(load: LoadDimension, res: Resource, executionIntervals: List<Pair<Instant, Instant>>): Boolean {
var result = false var result = false
var repetitionCounter = 1 var repetitionCounter = 1
......
...@@ -3,13 +3,16 @@ package theodolite.evaluation ...@@ -3,13 +3,16 @@ package theodolite.evaluation
import theodolite.util.InvalidPatcherConfigurationException import theodolite.util.InvalidPatcherConfigurationException
import javax.enterprise.context.ApplicationScoped import javax.enterprise.context.ApplicationScoped
private const val CONSUMER_LAG_QUERY = "sum by(group)(kafka_consumergroup_group_lag >= 0)"
private const val DROPPED_RECORDS_QUERY = "sum by(job) (kafka_streams_stream_task_metrics_dropped_records_total>=0)"
@ApplicationScoped @ApplicationScoped
class SloConfigHandler() { class SloConfigHandler() {
companion object { companion object {
fun getQueryString(sloType: String): String { fun getQueryString(sloType: String): String {
return when (sloType.toLowerCase()) { return when (sloType.toLowerCase()) {
SloTypes.LAG_TREND.value, SloTypes.LAG_TREND_RATIO.value -> "sum by(group)(kafka_consumergroup_group_lag >= 0)" SloTypes.LAG_TREND.value, SloTypes.LAG_TREND_RATIO.value -> CONSUMER_LAG_QUERY
SloTypes.DROPPED_RECORDS.value, SloTypes.DROPPED_RECORDS_RATIO.value -> "sum by(job) (kafka_streams_stream_task_metrics_dropped_records_total>=0)" SloTypes.DROPPED_RECORDS.value, SloTypes.DROPPED_RECORDS_RATIO.value -> DROPPED_RECORDS_QUERY
else -> throw InvalidPatcherConfigurationException("Could not find Prometheus query string for slo type $sloType") else -> throw InvalidPatcherConfigurationException("Could not find Prometheus query string for slo type $sloType")
} }
} }
......
...@@ -53,7 +53,6 @@ class BenchmarkExecutorImpl( ...@@ -53,7 +53,6 @@ class BenchmarkExecutorImpl(
* Analyse the experiment, if [run] is true, otherwise the experiment was canceled by the user. * Analyse the experiment, if [run] is true, otherwise the experiment was canceled by the user.
*/ */
if (this.run.get()) { if (this.run.get()) {
val experimentResults = slos.map { val experimentResults = slos.map {
AnalysisExecutor(slo = it, executionId = executionId) AnalysisExecutor(slo = it, executionId = executionId)
.analyze( .analyze(
...@@ -65,7 +64,6 @@ class BenchmarkExecutorImpl( ...@@ -65,7 +64,6 @@ class BenchmarkExecutorImpl(
result = (false !in experimentResults) result = (false !in experimentResults)
this.results.setResult(Pair(load, res), result) this.results.setResult(Pair(load, res), result)
} }
return result return result
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment