mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Clear shutdown of scheduler metrics recorder
This commit is contained in:
@@ -227,9 +227,9 @@ func WithCaptureProfile(c CaptureProfile) Option {
|
||||
}
|
||||
}
|
||||
|
||||
func defaultFrameworkOptions() frameworkOptions {
|
||||
func defaultFrameworkOptions(stopCh <-chan struct{}) frameworkOptions {
|
||||
return frameworkOptions{
|
||||
metricsRecorder: newMetricsRecorder(1000, time.Second),
|
||||
metricsRecorder: newMetricsRecorder(1000, time.Second, stopCh),
|
||||
clusterEventMap: make(map[framework.ClusterEvent]sets.String),
|
||||
parallelizer: parallelize.NewParallelizer(parallelize.DefaultParallelism),
|
||||
}
|
||||
@@ -245,8 +245,8 @@ func WithClusterEventMap(m map[framework.ClusterEvent]sets.String) Option {
|
||||
var _ framework.Framework = &frameworkImpl{}
|
||||
|
||||
// NewFramework initializes plugins given the configuration and the registry.
|
||||
func NewFramework(r Registry, profile *config.KubeSchedulerProfile, opts ...Option) (framework.Framework, error) {
|
||||
options := defaultFrameworkOptions()
|
||||
func NewFramework(r Registry, profile *config.KubeSchedulerProfile, stopCh <-chan struct{}, opts ...Option) (framework.Framework, error) {
|
||||
options := defaultFrameworkOptions(stopCh)
|
||||
for _, opt := range opts {
|
||||
opt(&options)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user