Merge pull request #97221 from 249043822/br-scheduler-metrics

cleanup constants for scheduler metrics
This commit is contained in:
Kubernetes Prow Robot 2020-12-14 17:45:56 -08:00 committed by GitHub
commit 989b2fd371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 9 deletions

View File

@ -525,9 +525,9 @@ func (g *genericScheduler) prioritizeNodes(
} }
wg.Add(1) wg.Add(1)
go func(extIndex int) { go func(extIndex int) {
metrics.SchedulerGoroutines.WithLabelValues("prioritizing_extender").Inc() metrics.SchedulerGoroutines.WithLabelValues(metrics.PrioritizingExtender).Inc()
defer func() { defer func() {
metrics.SchedulerGoroutines.WithLabelValues("prioritizing_extender").Dec() metrics.SchedulerGoroutines.WithLabelValues(metrics.PrioritizingExtender).Dec()
wg.Done() wg.Done()
}() }()
prioritizedList, weight, err := g.extenders[extIndex].Prioritize(pod, nodes) prioritizedList, weight, err := g.extenders[extIndex].Prioritize(pod, nodes)

View File

@ -28,13 +28,10 @@ import (
const ( const (
// SchedulerSubsystem - subsystem name used by scheduler // SchedulerSubsystem - subsystem name used by scheduler
SchedulerSubsystem = "scheduler" SchedulerSubsystem = "scheduler"
// OperationLabel - operation label name
OperationLabel = "operation"
// Below are possible values for the operation label. Each represents a substep of e2e scheduling: // Below are possible values for the operation label. Each represents a substep of e2e scheduling:
// PreemptionEvaluation - preemption evaluation operation label value (occurs in case of scheduling fitError). // PrioritizingExtender - prioritizing extender operation label value
PreemptionEvaluation = "preemption_evaluation" PrioritizingExtender = "prioritizing_extender"
// Binding - binding operation label value // Binding - binding operation label value
Binding = "binding" Binding = "binding"
// E2eScheduling - e2e scheduling operation label value // E2eScheduling - e2e scheduling operation label value

View File

@ -540,8 +540,8 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
go func() { go func() {
bindingCycleCtx, cancel := context.WithCancel(ctx) bindingCycleCtx, cancel := context.WithCancel(ctx)
defer cancel() defer cancel()
metrics.SchedulerGoroutines.WithLabelValues("binding").Inc() metrics.SchedulerGoroutines.WithLabelValues(metrics.Binding).Inc()
defer metrics.SchedulerGoroutines.WithLabelValues("binding").Dec() defer metrics.SchedulerGoroutines.WithLabelValues(metrics.Binding).Dec()
waitOnPermitStatus := fwk.WaitOnPermit(bindingCycleCtx, assumedPod) waitOnPermitStatus := fwk.WaitOnPermit(bindingCycleCtx, assumedPod)
if !waitOnPermitStatus.IsSuccess() { if !waitOnPermitStatus.IsSuccess() {