mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #115082 from sanposhiho/filter-metrics
feature(scheduler): implement plugin_evaluation_total metric
This commit is contained in:
		@@ -617,6 +617,7 @@ func (f *frameworkImpl) RunPreFilterPlugins(ctx context.Context, state *framewor
 | 
				
			|||||||
			skipPlugins.Insert(pl.Name())
 | 
								skipPlugins.Insert(pl.Name())
 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							metrics.PluginEvaluationTotal.WithLabelValues(pl.Name(), preFilter, f.profileName).Inc()
 | 
				
			||||||
		if !s.IsSuccess() {
 | 
							if !s.IsSuccess() {
 | 
				
			||||||
			s.SetFailedPlugin(pl.Name())
 | 
								s.SetFailedPlugin(pl.Name())
 | 
				
			||||||
			if s.IsUnschedulable() {
 | 
								if s.IsUnschedulable() {
 | 
				
			||||||
@@ -734,6 +735,7 @@ func (f *frameworkImpl) RunFilterPlugins(
 | 
				
			|||||||
		if state.SkipFilterPlugins.Has(pl.Name()) {
 | 
							if state.SkipFilterPlugins.Has(pl.Name()) {
 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							metrics.PluginEvaluationTotal.WithLabelValues(pl.Name(), Filter, f.profileName).Inc()
 | 
				
			||||||
		if status := f.runFilterPlugin(ctx, pl, state, pod, nodeInfo); !status.IsSuccess() {
 | 
							if status := f.runFilterPlugin(ctx, pl, state, pod, nodeInfo); !status.IsSuccess() {
 | 
				
			||||||
			if !status.IsUnschedulable() {
 | 
								if !status.IsUnschedulable() {
 | 
				
			||||||
				// Filter plugins are not supposed to return any status other than
 | 
									// Filter plugins are not supposed to return any status other than
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -189,6 +189,14 @@ var (
 | 
				
			|||||||
			StabilityLevel: metrics.ALPHA,
 | 
								StabilityLevel: metrics.ALPHA,
 | 
				
			||||||
		}, []string{"plugin", "profile"})
 | 
							}, []string{"plugin", "profile"})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						PluginEvaluationTotal = metrics.NewCounterVec(
 | 
				
			||||||
 | 
							&metrics.CounterOpts{
 | 
				
			||||||
 | 
								Subsystem:      SchedulerSubsystem,
 | 
				
			||||||
 | 
								Name:           "plugin_evaluation_total",
 | 
				
			||||||
 | 
								Help:           "Number of attempts to schedule pods by each plugin and the extension point (available only in PreFilter and Filter.).",
 | 
				
			||||||
 | 
								StabilityLevel: metrics.ALPHA,
 | 
				
			||||||
 | 
							}, []string{"plugin", "extension_point", "profile"})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	metricsList = []metrics.Registerable{
 | 
						metricsList = []metrics.Registerable{
 | 
				
			||||||
		scheduleAttempts,
 | 
							scheduleAttempts,
 | 
				
			||||||
		e2eSchedulingLatency,
 | 
							e2eSchedulingLatency,
 | 
				
			||||||
@@ -207,6 +215,7 @@ var (
 | 
				
			|||||||
		PermitWaitDuration,
 | 
							PermitWaitDuration,
 | 
				
			||||||
		CacheSize,
 | 
							CacheSize,
 | 
				
			||||||
		unschedulableReasons,
 | 
							unschedulableReasons,
 | 
				
			||||||
 | 
							PluginEvaluationTotal,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user