mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
Merge pull request #115519 from sanposhiho/move-metric-recorder
cleanup(scheduler): move metricRecorder to metrics package
This commit is contained in:
@@ -2829,7 +2829,7 @@ func TestPermitPlugins(t *testing.T) {
|
||||
}
|
||||
|
||||
// withMetricsRecorder set metricsRecorder for the scheduling frameworkImpl.
|
||||
func withMetricsRecorder(recorder *metricsRecorder) Option {
|
||||
func withMetricsRecorder(recorder *metrics.MetricAsyncRecorder) Option {
|
||||
return func(o *frameworkOptions) {
|
||||
o.metricsRecorder = recorder
|
||||
}
|
||||
@@ -2985,7 +2985,7 @@ func TestRecordingMetrics(t *testing.T) {
|
||||
}
|
||||
|
||||
stopCh := make(chan struct{})
|
||||
recorder := newMetricsRecorder(100, time.Nanosecond, stopCh)
|
||||
recorder := metrics.NewMetricsAsyncRecorder(100, time.Nanosecond, stopCh)
|
||||
profile := config.KubeSchedulerProfile{
|
||||
PercentageOfNodesToScore: pointer.Int32(testPercentageOfNodesToScore),
|
||||
SchedulerName: testProfileName,
|
||||
@@ -3001,9 +3001,9 @@ func TestRecordingMetrics(t *testing.T) {
|
||||
|
||||
// Stop the goroutine which records metrics and ensure it's stopped.
|
||||
close(stopCh)
|
||||
<-recorder.isStoppedCh
|
||||
<-recorder.IsStoppedCh
|
||||
// Try to clean up the metrics buffer again in case it's not empty.
|
||||
recorder.flushMetrics()
|
||||
recorder.FlushMetrics()
|
||||
|
||||
collectAndCompareFrameworkMetrics(t, tt.wantExtensionPoint, tt.wantStatus)
|
||||
collectAndComparePluginMetrics(t, tt.wantExtensionPoint, testPlugin, tt.wantStatus)
|
||||
@@ -3097,7 +3097,7 @@ func TestRunBindPlugins(t *testing.T) {
|
||||
}
|
||||
plugins := &config.Plugins{Bind: pluginSet}
|
||||
stopCh := make(chan struct{})
|
||||
recorder := newMetricsRecorder(100, time.Nanosecond, stopCh)
|
||||
recorder := metrics.NewMetricsAsyncRecorder(100, time.Nanosecond, stopCh)
|
||||
profile := config.KubeSchedulerProfile{
|
||||
SchedulerName: testProfileName,
|
||||
PercentageOfNodesToScore: pointer.Int32(testPercentageOfNodesToScore),
|
||||
@@ -3116,9 +3116,9 @@ func TestRunBindPlugins(t *testing.T) {
|
||||
|
||||
// Stop the goroutine which records metrics and ensure it's stopped.
|
||||
close(stopCh)
|
||||
<-recorder.isStoppedCh
|
||||
<-recorder.IsStoppedCh
|
||||
// Try to clean up the metrics buffer again in case it's not empty.
|
||||
recorder.flushMetrics()
|
||||
recorder.FlushMetrics()
|
||||
collectAndCompareFrameworkMetrics(t, "Bind", tt.wantStatus)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user