File tree 2 files changed +14
-0
lines changed
staging/src/k8s.io/apiserver/pkg/storage/cacher
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -462,10 +462,12 @@ func (c *Cacher) startCaching(stopChannel <-chan struct{}) {
462
462
c .ready .set (true )
463
463
klog .V (1 ).Infof ("cacher (%v): initialized" , c .groupResource .String ())
464
464
metrics .WatchCacheInitializations .WithLabelValues (c .groupResource .String ()).Inc ()
465
+ metrics .WatchCacheReady .WithLabelValues (c .groupResource .String ()).Set (1 )
465
466
})
466
467
defer func () {
467
468
if successfulList {
468
469
c .ready .set (false )
470
+ metrics .WatchCacheReady .WithLabelValues (c .groupResource .String ()).Set (0 )
469
471
}
470
472
}()
471
473
Original file line number Diff line number Diff line change @@ -147,6 +147,17 @@ var (
147
147
[]string {"resource" },
148
148
)
149
149
150
+ WatchCacheReady = compbasemetrics .NewGaugeVec (
151
+ & compbasemetrics.GaugeOpts {
152
+ Namespace : namespace ,
153
+ Subsystem : subsystem ,
154
+ Name : "ready" ,
155
+ Help : "Readiness of the watch cache broken by resource type." ,
156
+ StabilityLevel : compbasemetrics .ALPHA ,
157
+ },
158
+ []string {"resource" },
159
+ )
160
+
150
161
WatchCacheInitializations = compbasemetrics .NewCounterVec (
151
162
& compbasemetrics.CounterOpts {
152
163
Namespace : namespace ,
@@ -195,6 +206,7 @@ func Register() {
195
206
legacyregistry .MustRegister (watchCacheCapacityIncreaseTotal )
196
207
legacyregistry .MustRegister (watchCacheCapacityDecreaseTotal )
197
208
legacyregistry .MustRegister (WatchCacheCapacity )
209
+ legacyregistry .MustRegister (WatchCacheReady )
198
210
legacyregistry .MustRegister (WatchCacheInitializations )
199
211
legacyregistry .MustRegister (WatchCacheReadWait )
200
212
legacyregistry .MustRegister (ConsistentReadTotal )
You can’t perform that action at this time.
0 commit comments