diff --git a/src/main/kotlin/net/cafesalam/profilerutil/benchmark/BenchmarkChecker.kt b/src/main/kotlin/net/cafesalam/profilerutil/benchmark/BenchmarkChecker.kt index eb235c7..b1f97ea 100644 --- a/src/main/kotlin/net/cafesalam/profilerutil/benchmark/BenchmarkChecker.kt +++ b/src/main/kotlin/net/cafesalam/profilerutil/benchmark/BenchmarkChecker.kt @@ -7,13 +7,13 @@ import kotlin.math.min object BenchmarkChecker { fun checkResults(before: List>, after: List>, threshold: Int): List { - // each row has [scenario_1_time, scenario_2_time ... scenario_n_time - val runs = min(before.minOf { it.size }, after.minOf { it.size }) - 2 + // each row has [scenario_1_time, scenario_2_time ... scenario_n_time + val runs = min(before.minOf { it.size }, after.minOf { it.size }) - 3 return (1..runs).map { scenarioNumber -> - // index 0 is the date, index 1 is the hash, so scenario 1 is index 2 - val scenarioIndex = scenarioNumber + 1 - val runsBefore = before.map { it[scenarioIndex].toString().toDouble() } - val runsAfter = after.map { it[scenarioIndex].toString().toDouble() } + // index 0 is the date, index 1 is the hash, index 2 is notes, so scenario 1 is index 3 + val scenarioIndex = scenarioNumber + 2 + val runsBefore = before.map { it[scenarioIndex].toString().replace(",", "").toDouble() } + val runsAfter = after.map { it[scenarioIndex].toString().replace(",", "").toDouble() } val stepDelta = StepFit.stepFit(runsBefore, runsAfter) if (stepDelta.absoluteValue >= threshold) { diff --git a/src/main/kotlin/net/cafesalam/profilerutil/task/CheckDeltaUtil.kt b/src/main/kotlin/net/cafesalam/profilerutil/task/CheckDeltaUtil.kt index 1ef5eeb..ce7d01d 100644 --- a/src/main/kotlin/net/cafesalam/profilerutil/task/CheckDeltaUtil.kt +++ b/src/main/kotlin/net/cafesalam/profilerutil/task/CheckDeltaUtil.kt @@ -31,8 +31,8 @@ object CheckDeltaUtil { val results = BenchmarkChecker.checkResults(before, after, threshold) results.forEachIndexed { index, scenarioResult -> - // date, git hash - val scenariosOffset = 2 + // date, git hash, notes + val scenariosOffset = 3 val gitHash = mergeToConsider[1] val scenario = scenariosRow[index + scenariosOffset]