You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ObserveInFlightEventsAsync observes the in_flight_events metric.
154
+
//
155
+
// Note that this function is not goroutine-safe;
156
+
// we don't lock the map deliberately for the performance reason and we assume the queue (i.e., the caller) takes lock before updating the in-flight events.
// Only flush the metric to the channel if the interval is reached.
161
+
// The values are flushed to Prometheus in the run() function, which runs once the interval time.
162
+
// Note: we implement this flushing here, not in FlushMetrics, because, if we did so, we would need to implement a lock for the map, which we want to avoid.
Copy file name to clipboardExpand all lines: pkg/scheduler/metrics/metrics.go
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,10 @@ const (
81
81
QueueingHintResultError="Error"
82
82
)
83
83
84
+
const (
85
+
PodPoppedInFlightEvent="PodPopped"
86
+
)
87
+
84
88
// All the histogram based metrics have 1ms as size for the smallest bucket.
85
89
var (
86
90
scheduleAttempts=metrics.NewCounterVec(
@@ -141,6 +145,13 @@ var (
141
145
Help: "Number of pending pods, by the queue type. 'active' means number of pods in activeQ; 'backoff' means number of pods in backoffQ; 'unschedulable' means number of pods in unschedulablePods that the scheduler attempted to schedule and failed; 'gated' is the number of unschedulable pods that the scheduler never attempted to schedule because they are gated.",
142
146
StabilityLevel: metrics.STABLE,
143
147
}, []string{"queue"})
148
+
InFlightEvents=metrics.NewGaugeVec(
149
+
&metrics.GaugeOpts{
150
+
Subsystem: SchedulerSubsystem,
151
+
Name: "inflight_events",
152
+
Help: "Number of events currently tracked in the scheduling queue.",
0 commit comments