mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Scheduler metrics: binding rate limiter saturation
This commit is contained in:
@@ -77,6 +77,7 @@ type Config struct {
|
||||
Binder Binder
|
||||
|
||||
// Rate at which we can create pods
|
||||
// If this field is nil, we don't have any rate limit.
|
||||
BindPodsRateLimiter util.RateLimiter
|
||||
|
||||
// NextPod should be a function that blocks until the next pod
|
||||
@@ -107,6 +108,12 @@ func New(c *Config) *Scheduler {
|
||||
|
||||
// Run begins watching and scheduling. It starts a goroutine and returns immediately.
|
||||
func (s *Scheduler) Run() {
|
||||
if s.config.BindPodsRateLimiter != nil {
|
||||
go util.Forever(func() {
|
||||
sat := s.config.BindPodsRateLimiter.Saturation()
|
||||
metrics.BindingRateLimiterSaturation.Set(sat)
|
||||
}, metrics.BindingSaturationReportInterval)
|
||||
}
|
||||
go util.Until(s.scheduleOne, 0, s.config.StopEverything)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user