mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #99844 from minbaev/scheduler-test-perf-optimization
add if check for number of scheduled pods to be greater than 0
This commit is contained in:
		@@ -256,13 +256,16 @@ func (tc *throughputCollector) run(ctx context.Context) {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			scheduled := len(podsScheduled)
 | 
								scheduled := len(podsScheduled)
 | 
				
			||||||
 | 
								// Only do sampling if number of scheduled pods is greater than zero
 | 
				
			||||||
 | 
								if scheduled > 0 {
 | 
				
			||||||
				samplingRatioSeconds := float64(throughputSampleFrequency) / float64(time.Second)
 | 
									samplingRatioSeconds := float64(throughputSampleFrequency) / float64(time.Second)
 | 
				
			||||||
				throughput := float64(scheduled-lastScheduledCount) / samplingRatioSeconds
 | 
									throughput := float64(scheduled-lastScheduledCount) / samplingRatioSeconds
 | 
				
			||||||
				tc.schedulingThroughputs = append(tc.schedulingThroughputs, throughput)
 | 
									tc.schedulingThroughputs = append(tc.schedulingThroughputs, throughput)
 | 
				
			||||||
				lastScheduledCount = scheduled
 | 
									lastScheduledCount = scheduled
 | 
				
			||||||
 | 
					 | 
				
			||||||
				klog.Infof("%d pods scheduled", lastScheduledCount)
 | 
									klog.Infof("%d pods scheduled", lastScheduledCount)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user