How to realize SchedulingLatency Index View in K8s
K8s how to achieve SchedulingLatency indicators view, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
1.1. Metrics.go indicator definition
Pkg/scheduler/metrics/metrics.go
SchedulingLatency = prometheus.NewSummaryVec (
Prometheus.SummaryOpts {
Subsystem: SchedulerSubsystem
Name: SchedulingLatencyName
Help: "Scheduling latency in seconds split by sub-parts of the scheduling operation"
/ / Make the sliding window of 5h.
/ / TODO: The value for this should be based on some SLI definition (long term).
MaxAge: 5 * time.Hour
}
[] string {OperationLabel}
)
Line 64: Scheduling latency in seconds split by sub-parts of the scheduling operation
A schedule is divided into the sum of the operating time of the subcomponents
1.1. Scheduler.go scheduling entry 1.1.1. Pkg/scheduler/scheduler.go
/ / Run begins watching and scheduling. It waits for cache to be synced, then starts a goroutine and returns immediately.
Func (sched * Scheduler) Run () {
If! sched.config.WaitForCacheSync () {
Return
}
Go wait.Until (sched.scheduleOne, 0, sched.config.StopEverything)
}
1.1.1. Core scheduling logic sequence
1. Sched.schedule
2. Sched.assumeVolumes
3. Sched.assume
4. Sched.bindVolumes
5. Sched.Cache
6. Sched.bind
1.1. Implementation of generic_scheduler.go scheduling algorithm 1.1.1. Is it helpful for pkg/scheduler/core/generic_scheduler.go to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.