mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +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",
|
Help: "Total preemption attempts in the cluster till now",
|
||||||
StabilityLevel: metrics.ALPHA,
|
StabilityLevel: metrics.ALPHA,
|
||||||
})
|
})
|
||||||
|
|
||||||
pendingPods = metrics.NewGaugeVec(
|
pendingPods = metrics.NewGaugeVec(
|
||||||
&metrics.GaugeOpts{
|
&metrics.GaugeOpts{
|
||||||
Subsystem: SchedulerSubsystem,
|
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.",
|
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,
|
StabilityLevel: metrics.ALPHA,
|
||||||
}, []string{"queue"})
|
}, []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(
|
PodSchedulingDuration = metrics.NewHistogram(
|
||||||
&metrics.HistogramOpts{
|
&metrics.HistogramOpts{
|
||||||
@ -279,6 +285,7 @@ var (
|
|||||||
PodSchedulingAttempts,
|
PodSchedulingAttempts,
|
||||||
FrameworkExtensionPointDuration,
|
FrameworkExtensionPointDuration,
|
||||||
SchedulerQueueIncomingPods,
|
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).
|
// bind the pod to its host asynchronously (we can do this b/c of the assumption step above).
|
||||||
go func() {
|
go func() {
|
||||||
|
metrics.SchedulerGoroutines.WithLabelValues("binding").Inc()
|
||||||
|
defer metrics.SchedulerGoroutines.WithLabelValues("binding").Dec()
|
||||||
|
|
||||||
// Bind volumes first before Pod
|
// Bind volumes first before Pod
|
||||||
if !allBound {
|
if !allBound {
|
||||||
err := sched.bindVolumes(assumedPod)
|
err := sched.bindVolumes(assumedPod)
|
||||||
|
Loading…
Reference in New Issue
Block a user