[evaluation-plugin] fix NPE in metrics computation

GitOrigin-RevId: 04b8b21fa6e30edbcd5c6837eaf382a5323fd380
This commit is contained in:
Alexey Kalina
2023-05-19 11:18:26 +02:00
committed by intellij-monorepo-bot
parent 46d847c7be
commit f1c1158b4d

View File

@@ -31,7 +31,7 @@ abstract class LatencyMetric(override val name: String) : Metric {
class MaxLatencyMetric : LatencyMetric(NAME) {
override val valueType = MetricValueType.INT
override fun compute(sample: List<Double>): Double = sample.max()
override fun compute(sample: List<Double>): Double = sample.maxOrNull() ?: Double.NaN
companion object {
const val NAME = "Max Latency"