mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #86586 from xiaoanyunfei/cleanup/deprecate_scheduler_duration_seconds
Deprecate scheduling_duration_seconds Summary metric
This commit is contained in:
commit
fdfcb00ede
@ -220,7 +220,7 @@ func (g *genericScheduler) Schedule(ctx context.Context, state *framework.CycleS
|
||||
trace.Step("Running postfilter plugins done")
|
||||
metrics.SchedulingAlgorithmPredicateEvaluationDuration.Observe(metrics.SinceInSeconds(startPredicateEvalTime))
|
||||
metrics.DeprecatedSchedulingAlgorithmPredicateEvaluationDuration.Observe(metrics.SinceInMicroseconds(startPredicateEvalTime))
|
||||
metrics.SchedulingLatency.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime))
|
||||
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime))
|
||||
metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime))
|
||||
|
||||
startPriorityEvalTime := time.Now()
|
||||
@ -243,7 +243,7 @@ func (g *genericScheduler) Schedule(ctx context.Context, state *framework.CycleS
|
||||
|
||||
metrics.SchedulingAlgorithmPriorityEvaluationDuration.Observe(metrics.SinceInSeconds(startPriorityEvalTime))
|
||||
metrics.DeprecatedSchedulingAlgorithmPriorityEvaluationDuration.Observe(metrics.SinceInMicroseconds(startPriorityEvalTime))
|
||||
metrics.SchedulingLatency.WithLabelValues(metrics.PriorityEvaluation).Observe(metrics.SinceInSeconds(startPriorityEvalTime))
|
||||
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PriorityEvaluation).Observe(metrics.SinceInSeconds(startPriorityEvalTime))
|
||||
metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.PriorityEvaluation).Observe(metrics.SinceInSeconds(startPriorityEvalTime))
|
||||
|
||||
host, err := g.selectHost(priorityList)
|
||||
|
@ -28,8 +28,8 @@ import (
|
||||
const (
|
||||
// SchedulerSubsystem - subsystem name used by scheduler
|
||||
SchedulerSubsystem = "scheduler"
|
||||
// SchedulingLatencyName - scheduler latency metric name
|
||||
SchedulingLatencyName = "scheduling_duration_seconds"
|
||||
// DeprecatedSchedulingDurationName - scheduler duration metric name which is deprecated
|
||||
DeprecatedSchedulingDurationName = "scheduling_duration_seconds"
|
||||
// DeprecatedSchedulingLatencyName - scheduler latency metric name which is deprecated
|
||||
DeprecatedSchedulingLatencyName = "scheduling_latency_seconds"
|
||||
|
||||
@ -62,16 +62,17 @@ var (
|
||||
// PodScheduleFailures counts how many pods could not be scheduled.
|
||||
PodScheduleFailures = scheduleAttempts.With(metrics.Labels{"result": "unschedulable"})
|
||||
// PodScheduleErrors counts how many pods could not be scheduled due to a scheduler error.
|
||||
PodScheduleErrors = scheduleAttempts.With(metrics.Labels{"result": "error"})
|
||||
SchedulingLatency = metrics.NewSummaryVec(
|
||||
PodScheduleErrors = scheduleAttempts.With(metrics.Labels{"result": "error"})
|
||||
DeprecatedSchedulingDuration = metrics.NewSummaryVec(
|
||||
&metrics.SummaryOpts{
|
||||
Subsystem: SchedulerSubsystem,
|
||||
Name: SchedulingLatencyName,
|
||||
Name: DeprecatedSchedulingDurationName,
|
||||
Help: "Scheduling latency in seconds split by sub-parts of the scheduling operation",
|
||||
// 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,
|
||||
MaxAge: 5 * time.Hour,
|
||||
StabilityLevel: metrics.ALPHA,
|
||||
DeprecatedVersion: "1.18.0",
|
||||
},
|
||||
[]string{OperationLabel},
|
||||
)
|
||||
@ -303,7 +304,7 @@ var (
|
||||
|
||||
metricsList = []metrics.Registerable{
|
||||
scheduleAttempts,
|
||||
SchedulingLatency,
|
||||
DeprecatedSchedulingDuration,
|
||||
DeprecatedSchedulingLatency,
|
||||
E2eSchedulingLatency,
|
||||
DeprecatedE2eSchedulingLatency,
|
||||
@ -366,7 +367,7 @@ func UnschedulablePods() metrics.GaugeMetric {
|
||||
|
||||
// Reset resets metrics
|
||||
func Reset() {
|
||||
SchedulingLatency.Reset()
|
||||
DeprecatedSchedulingDuration.Reset()
|
||||
DeprecatedSchedulingLatency.Reset()
|
||||
}
|
||||
|
||||
|
@ -583,7 +583,7 @@ func (sched *Scheduler) bind(ctx context.Context, assumed *v1.Pod, targetNode st
|
||||
|
||||
metrics.BindingLatency.Observe(metrics.SinceInSeconds(bindingStart))
|
||||
metrics.DeprecatedBindingLatency.Observe(metrics.SinceInMicroseconds(bindingStart))
|
||||
metrics.SchedulingLatency.WithLabelValues(metrics.Binding).Observe(metrics.SinceInSeconds(bindingStart))
|
||||
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.Binding).Observe(metrics.SinceInSeconds(bindingStart))
|
||||
metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.Binding).Observe(metrics.SinceInSeconds(bindingStart))
|
||||
sched.Recorder.Eventf(assumed, nil, v1.EventTypeNormal, "Scheduled", "Binding", "Successfully assigned %v/%v to %v", assumed.Namespace, assumed.Name, targetNode)
|
||||
return nil
|
||||
@ -628,7 +628,7 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
|
||||
metrics.PreemptionAttempts.Inc()
|
||||
metrics.SchedulingAlgorithmPreemptionEvaluationDuration.Observe(metrics.SinceInSeconds(preemptionStartTime))
|
||||
metrics.DeprecatedSchedulingAlgorithmPreemptionEvaluationDuration.Observe(metrics.SinceInMicroseconds(preemptionStartTime))
|
||||
metrics.SchedulingLatency.WithLabelValues(metrics.PreemptionEvaluation).Observe(metrics.SinceInSeconds(preemptionStartTime))
|
||||
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PreemptionEvaluation).Observe(metrics.SinceInSeconds(preemptionStartTime))
|
||||
metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.PreemptionEvaluation).Observe(metrics.SinceInSeconds(preemptionStartTime))
|
||||
}
|
||||
// Pod did not fit anywhere, so it is counted as a failure. If preemption
|
||||
|
Loading…
Reference in New Issue
Block a user