Merge pull request #94884 from arghya88/remove-deprecated-scheduler-metrics

removing deprecated scheduler metrics
This commit is contained in:
Kubernetes Prow Robot 2020-09-22 14:42:32 -07:00 committed by GitHub
commit 18782e9996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 1 additions and 61 deletions

View File

@ -16,7 +16,6 @@ go_library(
"//pkg/scheduler:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
"//pkg/scheduler/metrics:go_default_library",
"//pkg/scheduler/profile:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/errors:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/authentication/authenticator:go_default_library",

View File

@ -53,7 +53,6 @@ import (
"k8s.io/kubernetes/pkg/scheduler"
kubeschedulerconfig "k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
"k8s.io/kubernetes/pkg/scheduler/metrics"
"k8s.io/kubernetes/pkg/scheduler/profile"
)
@ -233,7 +232,6 @@ func installMetricHandler(pathRecorderMux *mux.PathRecorderMux) {
defaultMetricsHandler := legacyregistry.Handler().ServeHTTP
pathRecorderMux.HandleFunc("/metrics", func(w http.ResponseWriter, req *http.Request) {
if req.Method == "DELETE" {
metrics.Reset()
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.Header().Set("X-Content-Type-Options", "nosniff")
io.WriteString(w, "metrics reset\n")

View File

@ -142,7 +142,6 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
return result, ErrNoNodesAvailable
}
startPredicateEvalTime := time.Now()
feasibleNodes, filteredNodesStatuses, err := g.findNodesThatFitPod(ctx, prof, state, pod)
if err != nil {
return result, err
@ -157,13 +156,8 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
}
}
metrics.DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration.Observe(metrics.SinceInSeconds(startPredicateEvalTime))
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime))
startPriorityEvalTime := time.Now()
// When only one node after predicate, just use it.
if len(feasibleNodes) == 1 {
metrics.DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration.Observe(metrics.SinceInSeconds(startPriorityEvalTime))
return ScheduleResult{
SuggestedHost: feasibleNodes[0].Name,
EvaluatedNodes: 1 + len(filteredNodesStatuses),
@ -176,9 +170,6 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
return result, err
}
metrics.DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration.Observe(metrics.SinceInSeconds(startPriorityEvalTime))
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PriorityEvaluation).Observe(metrics.SinceInSeconds(startPriorityEvalTime))
host, err := g.selectHost(priorityList)
trace.Step("Prioritizing done")

View File

@ -80,7 +80,6 @@ func (pl *DefaultPreemption) PostFilter(ctx context.Context, state *framework.Cy
defer func() {
metrics.PreemptionAttempts.Inc()
metrics.SchedulingAlgorithmPreemptionEvaluationDuration.Observe(metrics.SinceInSeconds(preemptionStartTime))
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PreemptionEvaluation).Observe(metrics.SinceInSeconds(preemptionStartTime))
}()
nnn, err := pl.preempt(ctx, state, pod, m)

View File

@ -28,17 +28,11 @@ import (
const (
// SchedulerSubsystem - subsystem name used by scheduler
SchedulerSubsystem = "scheduler"
// DeprecatedSchedulingDurationName - scheduler duration metric name which is deprecated
DeprecatedSchedulingDurationName = "scheduling_duration_seconds"
// OperationLabel - operation label name
OperationLabel = "operation"
// Below are possible values for the operation label. Each represents a substep of e2e scheduling:
// PredicateEvaluation - predicate evaluation operation label value
PredicateEvaluation = "predicate_evaluation"
// PriorityEvaluation - priority evaluation operation label value
PriorityEvaluation = "priority_evaluation"
// PreemptionEvaluation - preemption evaluation operation label value (occurs in case of scheduling fitError).
PreemptionEvaluation = "preemption_evaluation"
// Binding - binding operation label value
@ -55,19 +49,7 @@ var (
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.",
StabilityLevel: metrics.ALPHA,
}, []string{"result", "profile"})
DeprecatedSchedulingDuration = metrics.NewSummaryVec(
&metrics.SummaryOpts{
Subsystem: SchedulerSubsystem,
Name: DeprecatedSchedulingDurationName,
Help: "Scheduling latency in seconds split by sub-parts of the scheduling operation (Deprecated since 1.19.0)",
// Make the sliding window of 5h.
// TODO: The value for this should be based on some SLI definition (long term).
MaxAge: 5 * time.Hour,
StabilityLevel: metrics.ALPHA,
DeprecatedVersion: "1.19.0",
},
[]string{OperationLabel},
)
e2eSchedulingLatency = metrics.NewHistogramVec(
&metrics.HistogramOpts{
Subsystem: SchedulerSubsystem,
@ -85,26 +67,6 @@ var (
StabilityLevel: metrics.ALPHA,
},
)
DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration = metrics.NewHistogram(
&metrics.HistogramOpts{
Subsystem: SchedulerSubsystem,
Name: "scheduling_algorithm_predicate_evaluation_seconds",
Help: "Scheduling algorithm predicate evaluation duration in seconds (Deprecated since 1.19.0)",
Buckets: metrics.ExponentialBuckets(0.001, 2, 15),
StabilityLevel: metrics.ALPHA,
DeprecatedVersion: "1.19.0",
},
)
DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration = metrics.NewHistogram(
&metrics.HistogramOpts{
Subsystem: SchedulerSubsystem,
Name: "scheduling_algorithm_priority_evaluation_seconds",
Help: "Scheduling algorithm priority evaluation duration in seconds (Deprecated since 1.19.0)",
Buckets: metrics.ExponentialBuckets(0.001, 2, 15),
StabilityLevel: metrics.ALPHA,
DeprecatedVersion: "1.19.0",
},
)
SchedulingAlgorithmPreemptionEvaluationDuration = metrics.NewHistogram(
&metrics.HistogramOpts{
Subsystem: SchedulerSubsystem,
@ -225,12 +187,9 @@ var (
metricsList = []metrics.Registerable{
scheduleAttempts,
DeprecatedSchedulingDuration,
e2eSchedulingLatency,
SchedulingAlgorithmLatency,
BindingLatency,
DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration,
DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration,
SchedulingAlgorithmPreemptionEvaluationDuration,
PreemptionVictims,
PreemptionAttempts,
@ -285,11 +244,6 @@ func UnschedulablePods() metrics.GaugeMetric {
return pendingPods.With(metrics.Labels{"queue": "unschedulable"})
}
// Reset resets metrics
func Reset() {
DeprecatedSchedulingDuration.Reset()
}
// SinceInSeconds gets the time since the specified start in seconds.
func SinceInSeconds(start time.Time) float64 {
return time.Since(start).Seconds()

View File

@ -418,7 +418,6 @@ func (sched *Scheduler) finishBinding(prof *profile.Profile, assumed *v1.Pod, ta
}
metrics.BindingLatency.Observe(metrics.SinceInSeconds(start))
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.Binding).Observe(metrics.SinceInSeconds(start))
prof.Recorder.Eventf(assumed, nil, v1.EventTypeNormal, "Scheduled", "Binding", "Successfully assigned %v/%v to %v", assumed.Namespace, assumed.Name, targetNode)
}