Merge pull request #100193 from Huang-Wei/p99-error

sched: fix a bug that literal 'p99' is mapped to 95th-percentile
This commit is contained in:
Kubernetes Prow Robot 2021-03-12 14:15:03 -08:00 committed by GitHub
commit 9d59046ee5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,7 +202,8 @@ func collectHistogram(metric string, labels map[string]string) *DataItem {
q50 := hist.Quantile(0.50)
q90 := hist.Quantile(0.90)
q99 := hist.Quantile(0.95)
q95 := hist.Quantile(0.95)
q99 := hist.Quantile(0.99)
avg := hist.Average()
msFactor := float64(time.Second) / float64(time.Millisecond)
@ -217,6 +218,7 @@ func collectHistogram(metric string, labels map[string]string) *DataItem {
Data: map[string]float64{
"Perc50": q50 * msFactor,
"Perc90": q90 * msFactor,
"Perc95": q95 * msFactor,
"Perc99": q99 * msFactor,
"Average": avg * msFactor,
},
@ -285,6 +287,7 @@ func (tc *throughputCollector) collect() []DataItem {
"Average": sum / float64(length),
"Perc50": tc.schedulingThroughputs[int(math.Ceil(float64(length*50)/100))-1],
"Perc90": tc.schedulingThroughputs[int(math.Ceil(float64(length*90)/100))-1],
"Perc95": tc.schedulingThroughputs[int(math.Ceil(float64(length*95)/100))-1],
"Perc99": tc.schedulingThroughputs[int(math.Ceil(float64(length*99)/100))-1],
}
throughputSummary.Unit = "pods/s"