mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
Merge pull request #83603 from Tabrizian/master
feat: change the `pod_preemption_victims` to Histogram
This commit is contained in:
commit
54f089fa08
@ -195,11 +195,13 @@ var (
|
|||||||
StabilityLevel: metrics.ALPHA,
|
StabilityLevel: metrics.ALPHA,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
PreemptionVictims = metrics.NewGauge(
|
PreemptionVictims = metrics.NewHistogram(
|
||||||
&metrics.GaugeOpts{
|
&metrics.HistogramOpts{
|
||||||
Subsystem: SchedulerSubsystem,
|
Subsystem: SchedulerSubsystem,
|
||||||
Name: "pod_preemption_victims",
|
Name: "pod_preemption_victims",
|
||||||
Help: "Number of selected preemption victims",
|
Help: "Number of selected preemption victims",
|
||||||
|
// we think #victims>50 is pretty rare, therefore [50, +Inf) is considered a single bucket.
|
||||||
|
Buckets: metrics.LinearBuckets(5, 5, 10),
|
||||||
StabilityLevel: metrics.ALPHA,
|
StabilityLevel: metrics.ALPHA,
|
||||||
})
|
})
|
||||||
PreemptionAttempts = metrics.NewCounter(
|
PreemptionAttempts = metrics.NewCounter(
|
||||||
|
@ -473,7 +473,7 @@ func (sched *Scheduler) preempt(state *framework.CycleState, fwk framework.Frame
|
|||||||
sched.Recorder.Eventf(victim, preemptor, v1.EventTypeNormal, "Preempted", "Preempting", "Preempted by %v/%v on node %v", preemptor.Namespace, preemptor.Name, nodeName)
|
sched.Recorder.Eventf(victim, preemptor, v1.EventTypeNormal, "Preempted", "Preempting", "Preempted by %v/%v on node %v", preemptor.Namespace, preemptor.Name, nodeName)
|
||||||
|
|
||||||
}
|
}
|
||||||
metrics.PreemptionVictims.Set(float64(len(victims)))
|
metrics.PreemptionVictims.Observe(float64(len(victims)))
|
||||||
}
|
}
|
||||||
// Clearing nominated pods should happen outside of "if node != nil". Node could
|
// Clearing nominated pods should happen outside of "if node != nil". Node could
|
||||||
// be nil when a pod with nominated node name is eligible to preempt again,
|
// be nil when a pod with nominated node name is eligible to preempt again,
|
||||||
|
Loading…
Reference in New Issue
Block a user