Skip to content

Commit 1d3c003

Browse files
authored
Merge pull request kubernetes#127267 from macsko/measure_evet_handling_and_qhints_duration_metrics_scheduler_perf
Measure event_handling and QHints duration metrics in scheduler_perf
2 parents 8e4d638 + c1f7b8e commit 1d3c003

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

test/integration/scheduler_perf/scheduler_perf.go

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ const (
9898
extensionPointsLabelName = "extension_point"
9999
resultLabelName = "result"
100100
pluginLabelName = "plugin"
101+
eventLabelName = "event"
101102
)
102103

103104
// Run with -v=2, this is the default log level in production.
@@ -149,6 +150,22 @@ var (
149150
values: metrics.ExtentionPoints,
150151
},
151152
},
153+
"scheduler_queueing_hint_execution_duration_seconds": {
154+
{
155+
label: pluginLabelName,
156+
values: PluginNames,
157+
},
158+
{
159+
label: eventLabelName,
160+
values: clusterEventsToLabels(schedframework.AllEvents),
161+
},
162+
},
163+
"scheduler_event_handling_duration_seconds": {
164+
{
165+
label: eventLabelName,
166+
values: clusterEventsToLabels(schedframework.AllEvents),
167+
},
168+
},
152169
},
153170
}
154171

@@ -177,6 +194,14 @@ var (
177194
}
178195
)
179196

197+
func clusterEventsToLabels(events []schedframework.ClusterEvent) []string {
198+
labels := make([]string, 0, len(events))
199+
for _, event := range events {
200+
labels = append(labels, event.Label)
201+
}
202+
return labels
203+
}
204+
180205
// testCase defines a set of test cases that intends to test the performance of
181206
// similar workloads of varying sizes with shared overall settings such as
182207
// feature gates and metrics collected.
@@ -1038,10 +1063,7 @@ func compareMetricWithThreshold(items []DataItem, threshold float64, metricSelec
10381063
}
10391064

10401065
func checkEmptyInFlightEvents() error {
1041-
labels := []string{metrics.PodPoppedInFlightEvent}
1042-
for _, event := range schedframework.AllEvents {
1043-
labels = append(labels, event.Label)
1044-
}
1066+
labels := append(clusterEventsToLabels(schedframework.AllEvents), metrics.PodPoppedInFlightEvent)
10451067
for _, label := range labels {
10461068
value, err := testutil.GetGaugeMetricValue(metrics.InFlightEvents.WithLabelValues(label))
10471069
if err != nil {

0 commit comments

Comments
 (0)