feat: Add function to reset label allow list for apiserver endpoints metrics
Kubernetes-commit: d3795eaf76e5ecc632325cfb598533c4e3c31704
This commit is contained in:
parent
3a2942bdff
commit
15884a5fd0
|
@ -416,6 +416,33 @@ func Reset() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ResetLabelAllowLists resets the label allow lists for all metrics.
|
||||||
|
// NOTE: This is only used for testing.
|
||||||
|
func ResetLabelAllowLists() {
|
||||||
|
for _, metric := range metrics {
|
||||||
|
if counterVec, ok := metric.(*compbasemetrics.CounterVec); ok {
|
||||||
|
counterVec.ResetLabelAllowLists()
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if gaugeVec, ok := metric.(*compbasemetrics.GaugeVec); ok {
|
||||||
|
gaugeVec.ResetLabelAllowLists()
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if histogramVec, ok := metric.(*compbasemetrics.HistogramVec); ok {
|
||||||
|
histogramVec.ResetLabelAllowLists()
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if summaryVec, ok := metric.(*compbasemetrics.SummaryVec); ok {
|
||||||
|
summaryVec.ResetLabelAllowLists()
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if timingHistogramVec, ok := metric.(*compbasemetrics.TimingHistogramVec); ok {
|
||||||
|
timingHistogramVec.ResetLabelAllowLists()
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// UpdateInflightRequestMetrics reports concurrency metrics classified by
|
// UpdateInflightRequestMetrics reports concurrency metrics classified by
|
||||||
// mutating vs Readonly.
|
// mutating vs Readonly.
|
||||||
func UpdateInflightRequestMetrics(phase string, nonmutating, mutating int) {
|
func UpdateInflightRequestMetrics(phase string, nonmutating, mutating int) {
|
||||||
|
|
Loading…
Reference in New Issue