[K/N] Performance infra fixes
This commit is contained in:
committed by
Space Team
parent
9f5165dc97
commit
1cf2f102a2
+1
@@ -8,6 +8,7 @@ package org.jetbrains.buildInfo
|
||||
import org.jetbrains.report.*
|
||||
import org.jetbrains.report.json.*
|
||||
|
||||
@JsExport
|
||||
data class Build(val buildNumber: String, val startTime: String, val finishTime: String, val branch: String,
|
||||
val commits: String, val failuresNumber: Int) {
|
||||
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ class BenchmarksIndexesDispatcher(connector: ElasticSearchConnector, val feature
|
||||
"bool": {
|
||||
"must": [
|
||||
{ "match": { "benchmarks.metric": "$metricName" } },
|
||||
{ "terms": { "benchmarks.name": [${samples.map { "\"${it.lowercase()}\"" }.joinToString()}] }}
|
||||
{ "terms": { "benchmarks.name": [${samples.joinToString { "\"$it\"" }}] }}
|
||||
]
|
||||
}
|
||||
}, "inner_hits": {
|
||||
|
||||
@@ -231,6 +231,10 @@ internal fun <T> orderedValues(values: List<T>, buildElement: (T) -> CompositeBu
|
||||
fun urlParameterToBaseFormat(value: dynamic) =
|
||||
value.toString().replace("_", " ")
|
||||
|
||||
@JsExport
|
||||
class ExportedPair<T, U>(val first: T, val second: U)
|
||||
|
||||
|
||||
// Routing of requests to current server.
|
||||
fun router(connector: ElasticSearchConnector) {
|
||||
val express = require("express")
|
||||
@@ -451,14 +455,14 @@ fun router(connector: ElasticSearchConnector) {
|
||||
buildSuffix = request.query.buildSuffix
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getBuildsNumbers(type, branch, target, buildsCountToShow, buildInfoIndex, beforeDate, afterDate).then { buildNumbers ->
|
||||
if (aggregation == "geomean") {
|
||||
// Get geometric mean for samples.
|
||||
benchmarksDispatcher.getGeometricMean(metric, target, buildNumbers, normalize,
|
||||
excludeNames, buildSuffix).then { geoMeansValues ->
|
||||
success(orderedValues(geoMeansValues, { it -> it.first }, branch == "master")
|
||||
.map { it.first.second to it.second })
|
||||
.map { ExportedPair(it.first.second, it.second) })
|
||||
}.catch { errorResponse ->
|
||||
println("Error during getting geometric mean")
|
||||
println(errorResponse)
|
||||
@@ -468,7 +472,7 @@ fun router(connector: ElasticSearchConnector) {
|
||||
benchmarksDispatcher.getSamples(metric, target, samples, buildsCountToShow, buildNumbers, normalize, buildSuffix)
|
||||
.then { geoMeansValues ->
|
||||
success(orderedValues(geoMeansValues, { it -> it.first }, branch == "master")
|
||||
.map { it.first.second to it.second })
|
||||
.map { ExportedPair(it.first.second, it.second) })
|
||||
}.catch { errorResponse ->
|
||||
println("Error during getting samples")
|
||||
println(errorResponse)
|
||||
@@ -688,7 +692,7 @@ fun BenchmarksReport.normalizeBenchmarksSet(dataForNormalization: Map<String, Li
|
||||
benchmarksList.value.map {
|
||||
NormalizedMeanVarianceBenchmark(it.name, it.status, it.score, it.metric,
|
||||
it.runtimeInUs, it.repeat, it.warmup, (it as MeanVarianceBenchmark).variance,
|
||||
dataForNormalization[benchmarksList.key]?.get(0)?.score?.let { golden -> it.score / golden } ?: 0.0)
|
||||
dataForNormalization[benchmarksList.key]?.get(0)?.score?.let { golden -> it.score.toDouble() / golden } ?: 0.0)
|
||||
}
|
||||
}.flatten()
|
||||
return BenchmarksReport(env, resultBenchmarksList, compiler)
|
||||
|
||||
@@ -53,6 +53,7 @@ fun getChartData(labels: List<String>, valuesList: Collection<List<*>>,
|
||||
fun getChartOptions(samples: Array<String>, yTitle: String, classNames: Array<String>? = null): dynamic {
|
||||
val chartOptions: dynamic = object {}
|
||||
chartOptions["fullWidth"] = true
|
||||
chartOptions["low"] = 0
|
||||
val paddingObject: dynamic = object {}
|
||||
paddingObject["right"] = 40
|
||||
chartOptions["chartPadding"] = paddingObject
|
||||
|
||||
Reference in New Issue
Block a user