Clean ups in IDE performance tests output
This commit is contained in:
@@ -46,7 +46,7 @@ data class Benchmark(
|
|||||||
hasError = if (metrics.any { it.ifHasError() == true }) true else null
|
hasError = if (metrics.any { it.ifHasError() == true }) true else null
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun String?.escapeName() = this?.replace(Regex("[^A-Za-z0-9_]"), "_")
|
private fun String?.escapeName() = this?.replace(Regex("[^A-Za-z0-9]"), "")
|
||||||
|
|
||||||
fun id(): String =
|
fun id(): String =
|
||||||
listOfNotNull(
|
listOfNotNull(
|
||||||
|
|||||||
+13
-11
@@ -12,14 +12,15 @@ fun main(args: Array<String>) {
|
|||||||
val argFile = File(args[0])
|
val argFile = File(args[0])
|
||||||
val groupBy = argFile.listFiles()
|
val groupBy = argFile.listFiles()
|
||||||
.filter { it.length() > 0 && it.name.startsWith("stats-") && it.extension == "json" }
|
.filter { it.length() > 0 && it.name.startsWith("stats-") && it.extension == "json" }
|
||||||
.map { it.loadBenchmark() }
|
.groupBy { it.name.replace("stats-", "").split("_")[0] }
|
||||||
.groupBy { it.benchmark }
|
|
||||||
|
|
||||||
groupBy.forEach { (k, benchmarks) ->
|
groupBy.forEach { (k, v) ->
|
||||||
if (benchmarks.isEmpty()) return@forEach
|
if (v.isEmpty()) return@forEach
|
||||||
|
|
||||||
|
val benchmarks = v.map { it.loadBenchmark() }
|
||||||
|
|
||||||
benchmarks.forEach { benchmark ->
|
benchmarks.forEach { benchmark ->
|
||||||
benchmark.metrics.firstOrNull { it.metricName == "_value" }?.let { metric ->
|
benchmark.metrics.firstOrNull { it.metricName == "" }?.let { metric ->
|
||||||
metric.rawMetrics?.firstOrNull { it.warmUp == true && it.index == 0 }?.let {
|
metric.rawMetrics?.firstOrNull { it.warmUp == true && it.index == 0 }?.let {
|
||||||
val warmUpBenchmark = Benchmark(
|
val warmUpBenchmark = Benchmark(
|
||||||
agentName = benchmark.agentName,
|
agentName = benchmark.agentName,
|
||||||
@@ -39,15 +40,16 @@ fun main(args: Array<String>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// build geom mean benchmark
|
// build geom mean benchmark
|
||||||
val first = benchmarks.first()
|
val first = v.first()
|
||||||
|
val loadBenchmark = first.loadBenchmark()
|
||||||
val geomMeanBenchmark = Benchmark(
|
val geomMeanBenchmark = Benchmark(
|
||||||
agentName = first.agentName,
|
agentName = loadBenchmark.agentName,
|
||||||
buildBranch = first.buildBranch,
|
buildBranch = loadBenchmark.buildBranch,
|
||||||
buildId = first.buildId,
|
buildId = loadBenchmark.buildId,
|
||||||
benchmark = first.benchmark,
|
benchmark = loadBenchmark.benchmark,
|
||||||
synthetic = true,
|
synthetic = true,
|
||||||
name = "geomMean",
|
name = "geomMean",
|
||||||
buildTimestamp = first.buildTimestamp
|
buildTimestamp = loadBenchmark.buildTimestamp
|
||||||
)
|
)
|
||||||
|
|
||||||
benchmarks
|
benchmarks
|
||||||
|
|||||||
Reference in New Issue
Block a user