@@ -62,9 +62,11 @@ type SchedulerMetrics struct {
6262 node * prometheus.GaugeVec
6363 nodeResourceUsage map [string ]* prometheus.GaugeVec
6464 schedulingLatency prometheus.Histogram
65+ schedulingCycle prometheus.Histogram
6566 sortingLatency * prometheus.HistogramVec
6667 tryNodeLatency prometheus.Histogram
6768 tryPreemptionLatency prometheus.Histogram
69+ tryNodeEvaluation prometheus.Histogram
6870 lock locking.RWMutex
6971}
7072
@@ -117,6 +119,17 @@ func InitSchedulerMetrics() *SchedulerMetrics {
117119 Buckets : prometheus .ExponentialBuckets (0.0001 , 10 , 8 ), // start from 0.1ms
118120 },
119121 )
122+
123+ s .schedulingCycle = prometheus .NewHistogram (
124+ prometheus.HistogramOpts {
125+ Namespace : Namespace ,
126+ Subsystem : SchedulerSubsystem ,
127+ Name : "scheduling_cycle_milliseconds" ,
128+ Help : "Time taken for a scheduling cycle, in seconds." ,
129+ Buckets : prometheus .ExponentialBuckets (0.0001 , 10 , 8 ),
130+ },
131+ )
132+
120133 s .sortingLatency = prometheus .NewHistogramVec (
121134 prometheus.HistogramOpts {
122135 Namespace : Namespace ,
@@ -136,6 +149,16 @@ func InitSchedulerMetrics() *SchedulerMetrics {
136149 },
137150 )
138151
152+ s .tryNodeEvaluation = prometheus .NewHistogram (
153+ prometheus.HistogramOpts {
154+ Namespace : Namespace ,
155+ Subsystem : SchedulerSubsystem ,
156+ Name : "trynode_evaluation_milliseconds" ,
157+ Help : "Time taken to evaluate nodes for a pod, in seconds." ,
158+ Buckets : prometheus .ExponentialBuckets (0.0001 , 10 , 8 ),
159+ },
160+ )
161+
139162 s .tryPreemptionLatency = prometheus .NewHistogram (
140163 prometheus.HistogramOpts {
141164 Namespace : Namespace ,
@@ -155,6 +178,8 @@ func InitSchedulerMetrics() *SchedulerMetrics {
155178 s .schedulingLatency ,
156179 s .sortingLatency ,
157180 s .tryNodeLatency ,
181+ s .schedulingCycle ,
182+ s .tryNodeEvaluation ,
158183 s .tryPreemptionLatency ,
159184 }
160185 for _ , metric := range metricsList {
@@ -182,6 +207,10 @@ func (m *SchedulerMetrics) ObserveSchedulingLatency(start time.Time) {
182207 m .schedulingLatency .Observe (SinceInSeconds (start ))
183208}
184209
210+ func (m * SchedulerMetrics ) ObserveSchedulingCycle (start time.Time ) {
211+ m .schedulingCycle .Observe (SinceInSeconds (start ))
212+ }
213+
185214func (m * SchedulerMetrics ) ObserveAppSortingLatency (start time.Time ) {
186215 m .sortingLatency .WithLabelValues (SortingApp ).Observe (SinceInSeconds (start ))
187216}
@@ -194,6 +223,10 @@ func (m *SchedulerMetrics) ObserveTryNodeLatency(start time.Time) {
194223 m .tryNodeLatency .Observe (SinceInSeconds (start ))
195224}
196225
226+ func (m * SchedulerMetrics ) ObserveTryNodeEvaluation (start time.Time ) {
227+ m .tryNodeEvaluation .Observe (SinceInSeconds (start ))
228+ }
229+
197230func (m * SchedulerMetrics ) ObserveTryPreemptionLatency (start time.Time ) {
198231 m .tryPreemptionLatency .Observe (SinceInSeconds (start ))
199232}
0 commit comments