Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to realize SchedulingLatency Index View in K8s

Shulou Source: shulou.com Published: 2022-05-31 19:38:15 09月22日 Update

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.

Tags: Scheduling metrics help clarity entry content for this articles beginners time more core knowledge algorithms components industry information information channels logic puzzles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info macOS MySQL Docker Shulou Technology