@@ -533,6 +533,21 @@ func createBatchPodSequential(f *framework.Framework, pods []*v1.Pod) (time.Dura
533
533
return batchLag , e2eLags
534
534
}
535
535
536
+ // verifyLatencyWithinThreshold verifies whether 50, 90 and 99th percentiles of a latency metric are
537
+ // within the expected threshold.
538
+ func verifyLatencyWithinThreshold (threshold , actual e2emetrics.LatencyMetric , metricName string ) error {
539
+ if actual .Perc50 > threshold .Perc50 {
540
+ return fmt .Errorf ("too high %v latency 50th percentile: %v" , metricName , actual .Perc50 )
541
+ }
542
+ if actual .Perc90 > threshold .Perc90 {
543
+ return fmt .Errorf ("too high %v latency 90th percentile: %v" , metricName , actual .Perc90 )
544
+ }
545
+ if actual .Perc99 > threshold .Perc99 {
546
+ return fmt .Errorf ("too high %v latency 99th percentile: %v" , metricName , actual .Perc99 )
547
+ }
548
+ return nil
549
+ }
550
+
536
551
// logAndVerifyLatency verifies that whether pod creation latency satisfies the limit.
537
552
func logAndVerifyLatency (batchLag time.Duration , e2eLags []e2emetrics.PodLatencyData , podStartupLimits e2emetrics.LatencyMetric ,
538
553
podBatchStartupLimit time.Duration , testInfo map [string ]string , isVerify bool ) {
@@ -549,7 +564,7 @@ func logAndVerifyLatency(batchLag time.Duration, e2eLags []e2emetrics.PodLatency
549
564
550
565
if isVerify {
551
566
// check whether e2e pod startup time is acceptable.
552
- framework .ExpectNoError (e2emetrics . VerifyLatencyWithinThreshold (podStartupLimits , podStartupLatency , "pod startup" ))
567
+ framework .ExpectNoError (verifyLatencyWithinThreshold (podStartupLimits , podStartupLatency , "pod startup" ))
553
568
554
569
// check bactch pod creation latency
555
570
if podBatchStartupLimit > 0 {
0 commit comments