@@ -79,6 +79,10 @@ type podStartupLatencyMeasurement struct {
79
79
podStartupEntries * measurementutil.ObjectTransitionTimes
80
80
podMetadata * measurementutil.PodsMetadata
81
81
threshold time.Duration
82
+ // Threshold for pod startup latency by percentile. The default value is threshold.
83
+ perc50Threshold time.Duration
84
+ perc90Threshold time.Duration
85
+ perc99Threshold time.Duration
82
86
}
83
87
84
88
// Execute supports two actions:
@@ -101,6 +105,18 @@ func (p *podStartupLatencyMeasurement) Execute(config *measurement.Config) ([]me
101
105
if err != nil {
102
106
return nil , err
103
107
}
108
+ p .perc50Threshold , err = util .GetDurationOrDefault (config .Params , "perc50Threshold" , p .threshold )
109
+ if err != nil {
110
+ return nil , err
111
+ }
112
+ p .perc90Threshold , err = util .GetDurationOrDefault (config .Params , "perc90Threshold" , p .threshold )
113
+ if err != nil {
114
+ return nil , err
115
+ }
116
+ p .perc99Threshold , err = util .GetDurationOrDefault (config .Params , "perc99Threshold" , p .threshold )
117
+ if err != nil {
118
+ return nil , err
119
+ }
104
120
return nil , p .start (config .ClusterFramework .GetClientSets ().GetClient ())
105
121
case "gather" :
106
122
schedulerName , err := util .GetStringOrDefault (config .Params , "schedulerName" , defaultSchedulerName )
@@ -255,7 +271,7 @@ func (p *podStartupLatencyMeasurement) gather(c clientset.Interface, identifier
255
271
transitions := podStartupTransitionsWithThreshold (p .threshold )
256
272
podStartupLatency := p .podStartupEntries .CalculateTransitionsLatency (transitions , check .filter )
257
273
258
- if slosErr := podStartupLatency ["pod_startup" ].VerifyThreshold (p .threshold ); slosErr != nil {
274
+ if slosErr := podStartupLatency ["pod_startup" ].VerifyThresholdByPercentile (p .perc50Threshold , p . perc90Threshold , p . perc99Threshold ); slosErr != nil {
259
275
err = errors .NewMetricViolationError ("pod startup" , slosErr .Error ())
260
276
klog .Errorf ("%s%s: %v" , check .namePrefix , p , err )
261
277
}
0 commit comments