From 19855c5bd57052e1a8066a422ab040e0c42d5ad3 Mon Sep 17 00:00:00 2001 From: Vladimir Dolzhenko Date: Sun, 7 Jun 2020 23:02:38 +0200 Subject: [PATCH] Tweaked performance-tests stats output --- .../test/org/jetbrains/kotlin/idea/perf/Stats.kt | 8 +++----- .../jetbrains/kotlin/idea/perf/util/logging.kt | 16 +++++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/Stats.kt b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/Stats.kt index 950cea0ee04..0d84f94556b 100644 --- a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/Stats.kt +++ b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/Stats.kt @@ -77,10 +77,8 @@ class Stats( val shortName = if (perfCounterName.endsWith(": time")) n.removeSuffix(": time") else null - shortName?.let { - TeamCity.test(it, durationMs = mean, includeStats = false) { - TeamCity.statValue(it, mean) - } + TeamCity.test(shortName, durationMs = mean) { + TeamCity.statValue(n, mean) } } @@ -172,7 +170,7 @@ class Stats( "$testName stability is $stabilityPercentage %, above accepted level of $acceptanceStabilityLevel %" } - TeamCity.test(stabilityName, errorDetails = error) { + TeamCity.test(stabilityName, errorDetails = error, includeStats = false) { TeamCity.statValue(stabilityName, stabilityPercentage) } } diff --git a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/util/logging.kt b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/util/logging.kt index b186a0acdc7..eefc0d19bed 100644 --- a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/util/logging.kt +++ b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/util/logging.kt @@ -42,16 +42,18 @@ object TeamCity { test(name, durationMs, errorDetails = if (errors.isNotEmpty()) toDetails(errors) else null, block = block) } - fun test(name: String, durationMs: Long? = null, includeStats: Boolean = true, errorDetails: String? = null, block: () -> Unit) { - testStarted(name) + fun test(name: String?, durationMs: Long? = null, includeStats: Boolean = true, errorDetails: String? = null, block: () -> Unit) { + name?.let { testStarted(it) } try { block() } finally { - if (includeStats) statValue(name, durationMs ?: -1) - if (errorDetails != null) { - testFailed(name, errorDetails) - } else { - testFinished(name, durationMs) + name?.let { + if (includeStats) statValue(it, durationMs ?: -1) + if (errorDetails != null) { + testFailed(it, errorDetails) + } else { + testFinished(it, durationMs) + } } } }