mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
scheduler_perf: use time.Ticker in throughput measurement
This commit is contained in:
parent
b86e725694
commit
518c502f54
@ -238,12 +238,13 @@ func (tc *throughputCollector) run(ctx context.Context) {
|
||||
klog.Fatalf("%v", err)
|
||||
}
|
||||
lastScheduledCount := len(podsScheduled)
|
||||
ticker := time.NewTicker(throughputSampleFrequency)
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
// TODO(#94665): use time.Ticker instead
|
||||
case <-time.After(throughputSampleFrequency):
|
||||
case <-ticker.C:
|
||||
podsScheduled, err := getScheduledPods(tc.podInformer, tc.namespaces...)
|
||||
if err != nil {
|
||||
klog.Fatalf("%v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user