From f401573e5c8170bb598665d9ce44d84b589515db Mon Sep 17 00:00:00 2001 From: Elena Lepilkina Date: Mon, 4 Apr 2022 09:09:57 +0300 Subject: [PATCH] [K/N][perf] Added chart for execution time of debug binaries on performance server --- .../kotlin/network/aws/AWSNetworkUtils.kt | 2 +- .../tools/performance-server/ui/index.ejs | 10 ++++++-- .../ui/src/main/kotlin/main.kt | 23 +++++++++++++++++-- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/kotlin-native/tools/performance-server/src/main/kotlin/network/aws/AWSNetworkUtils.kt b/kotlin-native/tools/performance-server/src/main/kotlin/network/aws/AWSNetworkUtils.kt index debe4cd266b..d07750d49ae 100644 --- a/kotlin-native/tools/performance-server/src/main/kotlin/network/aws/AWSNetworkUtils.kt +++ b/kotlin-native/tools/performance-server/src/main/kotlin/network/aws/AWSNetworkUtils.kt @@ -64,7 +64,7 @@ class AWSNetworkConnector : NetworkConnector() { override fun sendBaseRequest(method: RequestMethod, path: String, user: String?, password: String?, acceptJsonContentType: Boolean, body: String?, errorHandler: (url: String, response: dynamic) -> Nothing?): Promise { - val useEnvironmentCredentials = false + val useEnvironmentCredentials = true // For easy test on localhost change to false. val AWSEndpoint = AWSInstance.Endpoint(AWSDomain) var request = AWSInstance.HttpRequest(AWSEndpoint, AWSRegion) request.method = method.toString() diff --git a/kotlin-native/tools/performance-server/ui/index.ejs b/kotlin-native/tools/performance-server/ui/index.ejs index 71efa251100..2c8e8e32a6b 100644 --- a/kotlin-native/tools/performance-server/ui/index.ejs +++ b/kotlin-native/tools/performance-server/ui/index.ejs @@ -79,7 +79,7 @@
-

Normalized execution time

+

Normalized execution time (release binaries)

@@ -98,7 +98,13 @@

- +

+
+

Normalized execution time (debug binaries)

+
+
+
+

Bundle size

diff --git a/kotlin-native/tools/performance-server/ui/src/main/kotlin/main.kt b/kotlin-native/tools/performance-server/ui/src/main/kotlin/main.kt index 5859117a72a..85627f982fe 100644 --- a/kotlin-native/tools/performance-server/ui/src/main/kotlin/main.kt +++ b/kotlin-native/tools/performance-server/ui/src/main/kotlin/main.kt @@ -190,7 +190,7 @@ fun getDatesComponents() = "${beforeDate?.let {"&before=${encodeURIComponent(it) "${afterDate?.let {"&after=${encodeURIComponent(it)}"} ?: ""}" fun main(args: Array) { - val serverUrl = "http://localhost:3000" + val serverUrl = "https://kotlin-native-perf-summary.labs.jb.gg" // use "http://localhost:3000" for local debug. val zoomRatio = 2 // Get parameters from request. @@ -290,6 +290,7 @@ fun main(args: Array) { } var execData = listOf() to listOf>() + var execDebugData = listOf() to listOf>() var compileData = listOf() to listOf>() var codeSizeData = listOf() to listOf>() var bundleSizeData = listOf() to listOf>() @@ -298,6 +299,7 @@ fun main(args: Array) { // Draw charts. var execChart: dynamic = null + var execChartDebug: dynamic = null var compileChart: dynamic = null var codeSizeChart: dynamic = null var bundleSizeChart: dynamic = null @@ -362,6 +364,11 @@ fun main(args: Array) { "agr" to "samples", "samples" to platformSpecificBenchs.removePrefix(",") ) else null).filterNotNull(), + "EXECUTION_TIME_DEBUG" to listOf(mapOf( + "normalize" to "true", + "buildSuffix" to "(Debug)" + ) + ), "BUNDLE_SIZE" to listOf(mapOf("samples" to "KotlinNative", "agr" to "samples")) ) @@ -385,7 +392,8 @@ fun main(args: Array) { (if (getParameters.isEmpty()) "?" else "&") + "branch=${parameters["branch"]}" else "" - val url = "$metricUrl$metric$getParameters$branchParameter${ + val requestedMetric = if (metric.startsWith("EXECUTION_TIME")) "EXECUTION_TIME" else metric + val url = "$metricUrl$requestedMetric$getParameters$branchParameter${ if (parameters["type"] != "all") (if (getParameters.isEmpty() && branchParameter.isEmpty()) "?" else "&") + "type=${parameters["type"]}" else "" @@ -434,6 +442,16 @@ fun main(args: Array) { execChart.update(getChartData(execData.first, execData.second)) } } + "EXECUTION_TIME_DEBUG" -> { + execDebugData = labels to values + execChartDebug = Chartist.Line("#exec_debug_chart", + getChartData(labels, execDebugData.second), + getChartOptions(arrayOf("Geometric Mean (All)"), "Normalized time")) + buildsInfoPromise.then { builds -> + customizeChart(execChartDebug, "exec_debug_chart", js("$(\"#exec_debug_chart\")"), builds, parameters) + execChartDebug.update(getChartData(execDebugData.first, execDebugData.second)) + } + } "CODE_SIZE" -> { codeSizeData = labels to values codeSizeChart = Chartist.Line("#codesize_chart", @@ -468,6 +486,7 @@ fun main(args: Array) { // Update all charts with using same data. val updateAllCharts: () -> Unit = { execChart.update(getChartData(execData.first, execData.second)) + execChartDebug.update(getChartData(execDebugData.first, execDebugData.second)) compileChart.update(getChartData(compileData.first, compileData.second)) codeSizeChart.update(getChartData(codeSizeData.first, codeSizeData.second, sizeClassNames)) bundleSizeChart.update(getChartData(bundleSizeData.first, bundleSizeData.second, sizeClassNames))