Merge pull request #116033 from chengjoey/fix/apiserver-metrics

fix apiserver metrics `RecordsWatchCacheCapacityChange` use watchCacheCapacity as increase total
This commit is contained in:
Kubernetes Prow Robot
2023-03-01 07:05:17 -08:00
committed by GitHub

View File

@@ -179,7 +179,7 @@ func RecordListCacheMetrics(resourcePrefix, indexName string, numFetched, numRet
func RecordsWatchCacheCapacityChange(objType string, old, new int) {
WatchCacheCapacity.WithLabelValues(objType).Set(float64(new))
if old < new {
WatchCacheCapacity.WithLabelValues(objType).Inc()
watchCacheCapacityIncreaseTotal.WithLabelValues(objType).Inc()
return
}
watchCacheCapacityDecreaseTotal.WithLabelValues(objType).Inc()