温馨提示  2024年 6月我们已经停止开发者板块文章内容更新,谢谢来访。存档数据
知识 2023-08-27 38 次阅读

k8s中怎样达成schedulinglatency 指标查看

   

k8s中怎样达成schedulinglatency 指标查看,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

1.1. metrics.go指标定义

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},

   )

第64行scheduling latency in seconds split by sub-parts of the scheduling operation

一次调度被分割为子组件的操作时间的和

1.1. scheduler.go调度入口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. 核心调度逻辑顺序

1. sched.schedule

2. sched.assumevolumes

3. sched.assume

4. sched.bindvolumes

5. sched.cache

6. sched.bind

1.1. generic,scheduler.go调度算法实现1.1.1. pkg/scheduler/core/generic,scheduler.go

看完上面的文章是否对您有帮助呢?如果还想对相关知识有深度的的了解或阅读更多相关文章,请关注云行业资讯频道,感谢您对云的支持。