mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Merge pull request #114771 from sanposhiho/scheduling_perf_scheduler_scheduling_attempt_duration_seconds
feature(scheduler_perf): distinguish result in scheduler_scheduling_attempt_duration_seconds metric result
This commit is contained in:
commit
2057a48ee5
@ -19,27 +19,27 @@ package metrics
|
||||
// This file contains helpers for metrics that are associated to a profile.
|
||||
|
||||
var (
|
||||
scheduledResult = "scheduled"
|
||||
unschedulableResult = "unschedulable"
|
||||
errorResult = "error"
|
||||
ScheduledResult = "scheduled"
|
||||
UnschedulableResult = "unschedulable"
|
||||
ErrorResult = "error"
|
||||
)
|
||||
|
||||
// PodScheduled can records a successful scheduling attempt and the duration
|
||||
// since `start`.
|
||||
func PodScheduled(profile string, duration float64) {
|
||||
observeScheduleAttemptAndLatency(scheduledResult, profile, duration)
|
||||
observeScheduleAttemptAndLatency(ScheduledResult, profile, duration)
|
||||
}
|
||||
|
||||
// PodUnschedulable can records a scheduling attempt for an unschedulable pod
|
||||
// and the duration since `start`.
|
||||
func PodUnschedulable(profile string, duration float64) {
|
||||
observeScheduleAttemptAndLatency(unschedulableResult, profile, duration)
|
||||
observeScheduleAttemptAndLatency(UnschedulableResult, profile, duration)
|
||||
}
|
||||
|
||||
// PodScheduleError can records a scheduling attempt that had an error and the
|
||||
// duration since `start`.
|
||||
func PodScheduleError(profile string, duration float64) {
|
||||
observeScheduleAttemptAndLatency(errorResult, profile, duration)
|
||||
observeScheduleAttemptAndLatency(ErrorResult, profile, duration)
|
||||
}
|
||||
|
||||
func observeScheduleAttemptAndLatency(result, profile string, duration float64) {
|
||||
|
@ -50,6 +50,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/scheduler/apis/config"
|
||||
"k8s.io/kubernetes/pkg/scheduler/apis/config/scheme"
|
||||
"k8s.io/kubernetes/pkg/scheduler/apis/config/validation"
|
||||
"k8s.io/kubernetes/pkg/scheduler/metrics"
|
||||
"k8s.io/kubernetes/test/integration/framework"
|
||||
testutils "k8s.io/kubernetes/test/utils"
|
||||
"k8s.io/kubernetes/test/utils/ktesting"
|
||||
@ -84,6 +85,7 @@ const (
|
||||
const (
|
||||
configFile = "config/performance-config.yaml"
|
||||
extensionPointsLabelName = "extension_point"
|
||||
resultLabelName = "result"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -93,8 +95,11 @@ var (
|
||||
label: extensionPointsLabelName,
|
||||
values: []string{"Filter", "Score"},
|
||||
},
|
||||
"scheduler_scheduling_attempt_duration_seconds": nil,
|
||||
"scheduler_pod_scheduling_duration_seconds": nil,
|
||||
"scheduler_scheduling_attempt_duration_seconds": {
|
||||
label: resultLabelName,
|
||||
values: []string{metrics.ScheduledResult, metrics.UnschedulableResult, metrics.ErrorResult},
|
||||
},
|
||||
"scheduler_pod_scheduling_duration_seconds": nil,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user