Commit 1b96e92c authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #16428 from wojtek-t/fix_latency_test

Auto commit by PR queue bot
parents 720dc879 c053ef2a
......@@ -63,9 +63,10 @@ func (a latencySlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a latencySlice) Less(i, j int) bool { return a[i].Latency < a[j].Latency }
func extractLatencyMetrics(latencies []podLatencyData) LatencyMetric {
perc50 := latencies[len(latencies)/2].Latency
perc90 := latencies[(len(latencies)*9)/10].Latency
perc99 := latencies[(len(latencies)*99)/100].Latency
length := len(latencies)
perc50 := latencies[int(math.Ceil(float64(length*50)/100))-1].Latency
perc90 := latencies[int(math.Ceil(float64(length*90)/100))-1].Latency
perc99 := latencies[int(math.Ceil(float64(length*99)/100))-1].Latency
return LatencyMetric{Perc50: perc50, Perc90: perc90, Perc99: perc99}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment