Skip to content

Commit c62f0dd

Browse files
committed
removing deprecated scheduler metrics
1 parent 3eb90c1 commit c62f0dd

File tree

6 files changed

+1
-61
lines changed

6 files changed

+1
-61
lines changed

cmd/kube-scheduler/app/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ go_library(
1616
"//pkg/scheduler:go_default_library",
1717
"//pkg/scheduler/apis/config:go_default_library",
1818
"//pkg/scheduler/framework/runtime:go_default_library",
19-
"//pkg/scheduler/metrics:go_default_library",
2019
"//pkg/scheduler/profile:go_default_library",
2120
"//staging/src/k8s.io/apimachinery/pkg/util/errors:go_default_library",
2221
"//staging/src/k8s.io/apiserver/pkg/authentication/authenticator:go_default_library",

cmd/kube-scheduler/app/server.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ import (
5353
"k8s.io/kubernetes/pkg/scheduler"
5454
kubeschedulerconfig "k8s.io/kubernetes/pkg/scheduler/apis/config"
5555
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
56-
"k8s.io/kubernetes/pkg/scheduler/metrics"
5756
"k8s.io/kubernetes/pkg/scheduler/profile"
5857
)
5958

@@ -233,7 +232,6 @@ func installMetricHandler(pathRecorderMux *mux.PathRecorderMux) {
233232
defaultMetricsHandler := legacyregistry.Handler().ServeHTTP
234233
pathRecorderMux.HandleFunc("/metrics", func(w http.ResponseWriter, req *http.Request) {
235234
if req.Method == "DELETE" {
236-
metrics.Reset()
237235
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
238236
w.Header().Set("X-Content-Type-Options", "nosniff")
239237
io.WriteString(w, "metrics reset\n")

pkg/scheduler/core/generic_scheduler.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
142142
return result, ErrNoNodesAvailable
143143
}
144144

145-
startPredicateEvalTime := time.Now()
146145
feasibleNodes, filteredNodesStatuses, err := g.findNodesThatFitPod(ctx, prof, state, pod)
147146
if err != nil {
148147
return result, err
@@ -157,13 +156,8 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
157156
}
158157
}
159158

160-
metrics.DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration.Observe(metrics.SinceInSeconds(startPredicateEvalTime))
161-
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime))
162-
163-
startPriorityEvalTime := time.Now()
164159
// When only one node after predicate, just use it.
165160
if len(feasibleNodes) == 1 {
166-
metrics.DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration.Observe(metrics.SinceInSeconds(startPriorityEvalTime))
167161
return ScheduleResult{
168162
SuggestedHost: feasibleNodes[0].Name,
169163
EvaluatedNodes: 1 + len(filteredNodesStatuses),
@@ -176,9 +170,6 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
176170
return result, err
177171
}
178172

179-
metrics.DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration.Observe(metrics.SinceInSeconds(startPriorityEvalTime))
180-
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PriorityEvaluation).Observe(metrics.SinceInSeconds(startPriorityEvalTime))
181-
182173
host, err := g.selectHost(priorityList)
183174
trace.Step("Prioritizing done")
184175

pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ func (pl *DefaultPreemption) PostFilter(ctx context.Context, state *framework.Cy
8080
defer func() {
8181
metrics.PreemptionAttempts.Inc()
8282
metrics.SchedulingAlgorithmPreemptionEvaluationDuration.Observe(metrics.SinceInSeconds(preemptionStartTime))
83-
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PreemptionEvaluation).Observe(metrics.SinceInSeconds(preemptionStartTime))
8483
}()
8584

8685
nnn, err := pl.preempt(ctx, state, pod, m)

pkg/scheduler/metrics/metrics.go

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,11 @@ import (
2828
const (
2929
// SchedulerSubsystem - subsystem name used by scheduler
3030
SchedulerSubsystem = "scheduler"
31-
// DeprecatedSchedulingDurationName - scheduler duration metric name which is deprecated
32-
DeprecatedSchedulingDurationName = "scheduling_duration_seconds"
3331

3432
// OperationLabel - operation label name
3533
OperationLabel = "operation"
3634
// Below are possible values for the operation label. Each represents a substep of e2e scheduling:
3735

38-
// PredicateEvaluation - predicate evaluation operation label value
39-
PredicateEvaluation = "predicate_evaluation"
40-
// PriorityEvaluation - priority evaluation operation label value
41-
PriorityEvaluation = "priority_evaluation"
4236
// PreemptionEvaluation - preemption evaluation operation label value (occurs in case of scheduling fitError).
4337
PreemptionEvaluation = "preemption_evaluation"
4438
// Binding - binding operation label value
@@ -55,19 +49,7 @@ var (
5549
Help: "Number of attempts to schedule pods, by the result. 'unschedulable' means a pod could not be scheduled, while 'error' means an internal scheduler problem.",
5650
StabilityLevel: metrics.ALPHA,
5751
}, []string{"result", "profile"})
58-
DeprecatedSchedulingDuration = metrics.NewSummaryVec(
59-
&metrics.SummaryOpts{
60-
Subsystem: SchedulerSubsystem,
61-
Name: DeprecatedSchedulingDurationName,
62-
Help: "Scheduling latency in seconds split by sub-parts of the scheduling operation (Deprecated since 1.19.0)",
63-
// Make the sliding window of 5h.
64-
// TODO: The value for this should be based on some SLI definition (long term).
65-
MaxAge: 5 * time.Hour,
66-
StabilityLevel: metrics.ALPHA,
67-
DeprecatedVersion: "1.19.0",
68-
},
69-
[]string{OperationLabel},
70-
)
52+
7153
e2eSchedulingLatency = metrics.NewHistogramVec(
7254
&metrics.HistogramOpts{
7355
Subsystem: SchedulerSubsystem,
@@ -85,26 +67,6 @@ var (
8567
StabilityLevel: metrics.ALPHA,
8668
},
8769
)
88-
DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration = metrics.NewHistogram(
89-
&metrics.HistogramOpts{
90-
Subsystem: SchedulerSubsystem,
91-
Name: "scheduling_algorithm_predicate_evaluation_seconds",
92-
Help: "Scheduling algorithm predicate evaluation duration in seconds (Deprecated since 1.19.0)",
93-
Buckets: metrics.ExponentialBuckets(0.001, 2, 15),
94-
StabilityLevel: metrics.ALPHA,
95-
DeprecatedVersion: "1.19.0",
96-
},
97-
)
98-
DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration = metrics.NewHistogram(
99-
&metrics.HistogramOpts{
100-
Subsystem: SchedulerSubsystem,
101-
Name: "scheduling_algorithm_priority_evaluation_seconds",
102-
Help: "Scheduling algorithm priority evaluation duration in seconds (Deprecated since 1.19.0)",
103-
Buckets: metrics.ExponentialBuckets(0.001, 2, 15),
104-
StabilityLevel: metrics.ALPHA,
105-
DeprecatedVersion: "1.19.0",
106-
},
107-
)
10870
SchedulingAlgorithmPreemptionEvaluationDuration = metrics.NewHistogram(
10971
&metrics.HistogramOpts{
11072
Subsystem: SchedulerSubsystem,
@@ -225,12 +187,9 @@ var (
225187

226188
metricsList = []metrics.Registerable{
227189
scheduleAttempts,
228-
DeprecatedSchedulingDuration,
229190
e2eSchedulingLatency,
230191
SchedulingAlgorithmLatency,
231192
BindingLatency,
232-
DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration,
233-
DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration,
234193
SchedulingAlgorithmPreemptionEvaluationDuration,
235194
PreemptionVictims,
236195
PreemptionAttempts,
@@ -285,11 +244,6 @@ func UnschedulablePods() metrics.GaugeMetric {
285244
return pendingPods.With(metrics.Labels{"queue": "unschedulable"})
286245
}
287246

288-
// Reset resets metrics
289-
func Reset() {
290-
DeprecatedSchedulingDuration.Reset()
291-
}
292-
293247
// SinceInSeconds gets the time since the specified start in seconds.
294248
func SinceInSeconds(start time.Time) float64 {
295249
return time.Since(start).Seconds()

pkg/scheduler/scheduler.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ func (sched *Scheduler) finishBinding(prof *profile.Profile, assumed *v1.Pod, ta
418418
}
419419

420420
metrics.BindingLatency.Observe(metrics.SinceInSeconds(start))
421-
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.Binding).Observe(metrics.SinceInSeconds(start))
422421
prof.Recorder.Eventf(assumed, nil, v1.EventTypeNormal, "Scheduled", "Binding", "Successfully assigned %v/%v to %v", assumed.Namespace, assumed.Name, targetNode)
423422
}
424423

0 commit comments

Comments
 (0)