@@ -62,9 +62,11 @@ type SchedulerMetrics struct {
62
62
node * prometheus.GaugeVec
63
63
nodeResourceUsage map [string ]* prometheus.GaugeVec
64
64
schedulingLatency prometheus.Histogram
65
+ schedulingCycle prometheus.Histogram
65
66
sortingLatency * prometheus.HistogramVec
66
67
tryNodeLatency prometheus.Histogram
67
68
tryPreemptionLatency prometheus.Histogram
69
+ tryNodeEvaluation prometheus.Histogram
68
70
lock locking.RWMutex
69
71
}
70
72
@@ -117,6 +119,17 @@ func InitSchedulerMetrics() *SchedulerMetrics {
117
119
Buckets : prometheus .ExponentialBuckets (0.0001 , 10 , 8 ), // start from 0.1ms
118
120
},
119
121
)
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
+
120
133
s .sortingLatency = prometheus .NewHistogramVec (
121
134
prometheus.HistogramOpts {
122
135
Namespace : Namespace ,
@@ -136,6 +149,16 @@ func InitSchedulerMetrics() *SchedulerMetrics {
136
149
},
137
150
)
138
151
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
+
139
162
s .tryPreemptionLatency = prometheus .NewHistogram (
140
163
prometheus.HistogramOpts {
141
164
Namespace : Namespace ,
@@ -155,6 +178,8 @@ func InitSchedulerMetrics() *SchedulerMetrics {
155
178
s .schedulingLatency ,
156
179
s .sortingLatency ,
157
180
s .tryNodeLatency ,
181
+ s .schedulingCycle ,
182
+ s .tryNodeEvaluation ,
158
183
s .tryPreemptionLatency ,
159
184
}
160
185
for _ , metric := range metricsList {
@@ -182,6 +207,10 @@ func (m *SchedulerMetrics) ObserveSchedulingLatency(start time.Time) {
182
207
m .schedulingLatency .Observe (SinceInSeconds (start ))
183
208
}
184
209
210
+ func (m * SchedulerMetrics ) ObserveSchedulingCycle (start time.Time ) {
211
+ m .schedulingCycle .Observe (SinceInSeconds (start ))
212
+ }
213
+
185
214
func (m * SchedulerMetrics ) ObserveAppSortingLatency (start time.Time ) {
186
215
m .sortingLatency .WithLabelValues (SortingApp ).Observe (SinceInSeconds (start ))
187
216
}
@@ -194,6 +223,10 @@ func (m *SchedulerMetrics) ObserveTryNodeLatency(start time.Time) {
194
223
m .tryNodeLatency .Observe (SinceInSeconds (start ))
195
224
}
196
225
226
+ func (m * SchedulerMetrics ) ObserveTryNodeEvaluation (start time.Time ) {
227
+ m .tryNodeEvaluation .Observe (SinceInSeconds (start ))
228
+ }
229
+
197
230
func (m * SchedulerMetrics ) ObserveTryPreemptionLatency (start time.Time ) {
198
231
m .tryPreemptionLatency .Observe (SinceInSeconds (start ))
199
232
}
0 commit comments