mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Add a metric to track number of scheduler binding goroutines
This commit is contained in:
parent
c634276498
commit
08f7b22025
@ -211,7 +211,6 @@ var (
|
||||
Help: "Total preemption attempts in the cluster till now",
|
||||
StabilityLevel: metrics.ALPHA,
|
||||
})
|
||||
|
||||
pendingPods = metrics.NewGaugeVec(
|
||||
&metrics.GaugeOpts{
|
||||
Subsystem: SchedulerSubsystem,
|
||||
@ -219,6 +218,13 @@ var (
|
||||
Help: "Number of pending pods, by the queue type. 'active' means number of pods in activeQ; 'backoff' means number of pods in backoffQ; 'unschedulable' means number of pods in unschedulableQ.",
|
||||
StabilityLevel: metrics.ALPHA,
|
||||
}, []string{"queue"})
|
||||
SchedulerGoroutines = metrics.NewGaugeVec(
|
||||
&metrics.GaugeOpts{
|
||||
Subsystem: SchedulerSubsystem,
|
||||
Name: "scheduler_goroutines",
|
||||
Help: "Number of running goroutines split by the work they do such as binding.",
|
||||
StabilityLevel: metrics.ALPHA,
|
||||
}, []string{"work"})
|
||||
|
||||
PodSchedulingDuration = metrics.NewHistogram(
|
||||
&metrics.HistogramOpts{
|
||||
@ -279,6 +285,7 @@ var (
|
||||
PodSchedulingAttempts,
|
||||
FrameworkExtensionPointDuration,
|
||||
SchedulerQueueIncomingPods,
|
||||
SchedulerGoroutines,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -675,6 +675,9 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
|
||||
}
|
||||
// bind the pod to its host asynchronously (we can do this b/c of the assumption step above).
|
||||
go func() {
|
||||
metrics.SchedulerGoroutines.WithLabelValues("binding").Inc()
|
||||
defer metrics.SchedulerGoroutines.WithLabelValues("binding").Dec()
|
||||
|
||||
// Bind volumes first before Pod
|
||||
if !allBound {
|
||||
err := sched.bindVolumes(assumedPod)
|
||||
|
Loading…
Reference in New Issue
Block a user