mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-16 07:13:53 +00:00
feature(scheduler_perf): distinguish result in scheduler_scheduling_attempt_duration_seconds metric result
This commit is contained in:
parent
8a71485643
commit
a4ea058cc7
@ -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) {
|
||||
|
@ -46,6 +46,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"
|
||||
"sigs.k8s.io/yaml"
|
||||
@ -75,6 +76,7 @@ const (
|
||||
const (
|
||||
configFile = "config/performance-config.yaml"
|
||||
extensionPointsLabelName = "extension_point"
|
||||
resultLabelName = "result"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -84,8 +86,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