mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #64392 from shyamjvs/fix-scheduler-throughput-metric
Automatic merge from submit-queue (batch tested with PRs 64392, 63885). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix bug with scheduler throughput variable pass-by-value Because I keep forgetting go slice semantics :p /cc @wojtek-t ```release-note NONE ```
This commit is contained in:
		@@ -227,7 +227,7 @@ func logPodStartupStatus(
 | 
				
			|||||||
	expectedPods int,
 | 
						expectedPods int,
 | 
				
			||||||
	observedLabels map[string]string,
 | 
						observedLabels map[string]string,
 | 
				
			||||||
	period time.Duration,
 | 
						period time.Duration,
 | 
				
			||||||
	scheduleThroughputs []float64,
 | 
						scheduleThroughputs *[]float64,
 | 
				
			||||||
	stopCh chan struct{}) {
 | 
						stopCh chan struct{}) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	label := labels.SelectorFromSet(labels.Set(observedLabels))
 | 
						label := labels.SelectorFromSet(labels.Set(observedLabels))
 | 
				
			||||||
@@ -250,14 +250,14 @@ func logPodStartupStatus(
 | 
				
			|||||||
		framework.Logf(startupStatus.String("Density"))
 | 
							framework.Logf(startupStatus.String("Density"))
 | 
				
			||||||
		// Compute scheduling throughput for the latest time period.
 | 
							// Compute scheduling throughput for the latest time period.
 | 
				
			||||||
		throughput := float64(startupStatus.Scheduled-lastScheduledCount) / float64(period/time.Second)
 | 
							throughput := float64(startupStatus.Scheduled-lastScheduledCount) / float64(period/time.Second)
 | 
				
			||||||
		scheduleThroughputs = append(scheduleThroughputs, throughput)
 | 
							*scheduleThroughputs = append(*scheduleThroughputs, throughput)
 | 
				
			||||||
		lastScheduledCount = startupStatus.Scheduled
 | 
							lastScheduledCount = startupStatus.Scheduled
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// runDensityTest will perform a density test and return the time it took for
 | 
					// runDensityTest will perform a density test and return the time it took for
 | 
				
			||||||
// all pods to start
 | 
					// all pods to start
 | 
				
			||||||
func runDensityTest(dtc DensityTestConfig, testPhaseDurations *timer.TestPhaseTimer, scheduleThroughputs []float64) time.Duration {
 | 
					func runDensityTest(dtc DensityTestConfig, testPhaseDurations *timer.TestPhaseTimer, scheduleThroughputs *[]float64) time.Duration {
 | 
				
			||||||
	defer GinkgoRecover()
 | 
						defer GinkgoRecover()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Create all secrets, configmaps and daemons.
 | 
						// Create all secrets, configmaps and daemons.
 | 
				
			||||||
@@ -647,7 +647,7 @@ var _ = SIGDescribe("Density", func() {
 | 
				
			|||||||
						LogFunc:   framework.Logf,
 | 
											LogFunc:   framework.Logf,
 | 
				
			||||||
					})
 | 
										})
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			e2eStartupTime = runDensityTest(dConfig, testPhaseDurations, scheduleThroughputs)
 | 
								e2eStartupTime = runDensityTest(dConfig, testPhaseDurations, &scheduleThroughputs)
 | 
				
			||||||
			if itArg.runLatencyTest {
 | 
								if itArg.runLatencyTest {
 | 
				
			||||||
				By("Scheduling additional Pods to measure startup latencies")
 | 
									By("Scheduling additional Pods to measure startup latencies")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user