mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Add Reset() API to stability framework
This commit is contained in:
parent
eedfb6bc7a
commit
ea40540f5c
@ -159,3 +159,12 @@ func (v *CounterVec) Delete(labels map[string]string) bool {
|
||||
}
|
||||
return v.CounterVec.Delete(labels)
|
||||
}
|
||||
|
||||
// Reset deletes all metrics in this vector.
|
||||
func (v *CounterVec) Reset() {
|
||||
if !v.IsCreated() {
|
||||
return
|
||||
}
|
||||
|
||||
v.CounterVec.Reset()
|
||||
}
|
||||
|
@ -161,6 +161,15 @@ func (v *GaugeVec) Delete(labels map[string]string) bool {
|
||||
return v.GaugeVec.Delete(labels)
|
||||
}
|
||||
|
||||
// Reset deletes all metrics in this vector.
|
||||
func (v *GaugeVec) Reset() {
|
||||
if !v.IsCreated() {
|
||||
return
|
||||
}
|
||||
|
||||
v.GaugeVec.Reset()
|
||||
}
|
||||
|
||||
func newGaugeFunc(opts GaugeOpts, function func() float64, v semver.Version) GaugeFunc {
|
||||
g := NewGauge(&opts)
|
||||
|
||||
|
@ -166,3 +166,12 @@ func (v *HistogramVec) Delete(labels map[string]string) bool {
|
||||
}
|
||||
return v.HistogramVec.Delete(labels)
|
||||
}
|
||||
|
||||
// Reset deletes all metrics in this vector.
|
||||
func (v *HistogramVec) Reset() {
|
||||
if !v.IsCreated() {
|
||||
return
|
||||
}
|
||||
|
||||
v.HistogramVec.Reset()
|
||||
}
|
||||
|
@ -160,3 +160,12 @@ func (v *SummaryVec) Delete(labels map[string]string) bool {
|
||||
}
|
||||
return v.SummaryVec.Delete(labels)
|
||||
}
|
||||
|
||||
// Reset deletes all metrics in this vector.
|
||||
func (v *SummaryVec) Reset() {
|
||||
if !v.IsCreated() {
|
||||
return
|
||||
}
|
||||
|
||||
v.SummaryVec.Reset()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user