@@ -133,6 +133,8 @@ func NewCommandStartAdapterServer(stopCh <-chan struct{}) *cobra.Command {
133
133
"disregard failing to create collectors for incompatible HPAs" )
134
134
flags .DurationVar (& o .MetricsTTL , "metrics-ttl" , 15 * time .Minute , "TTL for metrics that are stored in in-memory cache." )
135
135
flags .DurationVar (& o .GCInterval , "garbage-collector-interval" , 10 * time .Minute , "Interval to clean up metrics that are stored in in-memory cache." )
136
+ flags .DurationVar (& o .CollectionInterval , "default-collection-interval" , 60 * time .Second , "Default interval used for collecting metrics." )
137
+ flags .DurationVar (& o .ResourceUpdateInterval , "resource-update-interval" , 30 * time .Second , "Interval at which HPA resources get updated." )
136
138
flags .BoolVar (& o .ScalingScheduleMetrics , "scaling-schedule" , o .ScalingScheduleMetrics , "" +
137
139
"whether to enable time-based ScalingSchedule metrics" )
138
140
flags .DurationVar (& o .DefaultScheduledScalingWindow , "scaling-schedule-default-scaling-window" , 10 * time .Minute , "Default rampup and rampdown window duration for ScalingSchedules" )
@@ -391,7 +393,7 @@ func (o AdapterServerOptions) RunCustomMetricsAdapterServer(stopCh <-chan struct
391
393
go scheduledScalingController .Run (ctx )
392
394
}
393
395
394
- hpaProvider := provider .NewHPAProvider (client , 30 * time . Second , 1 * time . Minute , collectorFactory , o .DisregardIncompatibleHPAs , o .MetricsTTL , o .GCInterval )
396
+ hpaProvider := provider .NewHPAProvider (client , o . ResourceUpdateInterval , o . CollectionInterval , collectorFactory , o .DisregardIncompatibleHPAs , o .MetricsTTL , o .GCInterval )
395
397
396
398
go hpaProvider .Run (ctx )
397
399
@@ -509,6 +511,10 @@ type AdapterServerOptions struct {
509
511
MetricsTTL time.Duration
510
512
// Interval to clean up metrics that are stored in in-memory cache
511
513
GCInterval time.Duration
514
+ // Default interval used for collecting metrics
515
+ CollectionInterval time.Duration
516
+ // Interval at which HPA resources get updated
517
+ ResourceUpdateInterval time.Duration
512
518
// Time-based scaling based on the CRDs ScheduleScaling and ClusterScheduleScaling.
513
519
ScalingScheduleMetrics bool
514
520
// Default ramp-up/ramp-down window duration for scheduled metrics
0 commit comments