mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update K8s packages to v0.32.1
Update K8s packages in go.mod to v0.32.1 Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
31
vendor/k8s.io/component-base/metrics/timing_histogram.go
generated
vendored
31
vendor/k8s.io/component-base/metrics/timing_histogram.go
generated
vendored
@ -18,6 +18,7 @@ package metrics
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/blang/semver/v4"
|
||||
@ -125,11 +126,6 @@ func NewTestableTimingHistogramVec(nowFunc func() time.Time, opts *TimingHistogr
|
||||
opts.StabilityLevel.setDefaults()
|
||||
|
||||
fqName := BuildFQName(opts.Namespace, opts.Subsystem, opts.Name)
|
||||
allowListLock.RLock()
|
||||
if allowList, ok := labelValueAllowLists[fqName]; ok {
|
||||
opts.LabelValueAllowLists = allowList
|
||||
}
|
||||
allowListLock.RUnlock()
|
||||
|
||||
v := &TimingHistogramVec{
|
||||
TimingHistogramVec: noopTimingHistogramVec,
|
||||
@ -175,6 +171,15 @@ func (v *TimingHistogramVec) WithLabelValuesChecked(lvs ...string) (GaugeMetric,
|
||||
}
|
||||
if v.LabelValueAllowLists != nil {
|
||||
v.LabelValueAllowLists.ConstrainToAllowedList(v.originalLabels, lvs)
|
||||
} else {
|
||||
v.initializeLabelAllowListsOnce.Do(func() {
|
||||
allowListLock.RLock()
|
||||
if allowList, ok := labelValueAllowLists[v.FQName()]; ok {
|
||||
v.LabelValueAllowLists = allowList
|
||||
allowList.ConstrainToAllowedList(v.originalLabels, lvs)
|
||||
}
|
||||
allowListLock.RUnlock()
|
||||
})
|
||||
}
|
||||
ops, err := v.TimingHistogramVec.GetMetricWithLabelValues(lvs...)
|
||||
if err != nil {
|
||||
@ -214,6 +219,15 @@ func (v *TimingHistogramVec) WithChecked(labels map[string]string) (GaugeMetric,
|
||||
}
|
||||
if v.LabelValueAllowLists != nil {
|
||||
v.LabelValueAllowLists.ConstrainLabelMap(labels)
|
||||
} else {
|
||||
v.initializeLabelAllowListsOnce.Do(func() {
|
||||
allowListLock.RLock()
|
||||
if allowList, ok := labelValueAllowLists[v.FQName()]; ok {
|
||||
v.LabelValueAllowLists = allowList
|
||||
allowList.ConstrainLabelMap(labels)
|
||||
}
|
||||
allowListLock.RUnlock()
|
||||
})
|
||||
}
|
||||
ops, err := v.TimingHistogramVec.GetMetricWith(labels)
|
||||
return ops.(GaugeMetric), err
|
||||
@ -254,6 +268,13 @@ func (v *TimingHistogramVec) Reset() {
|
||||
v.TimingHistogramVec.Reset()
|
||||
}
|
||||
|
||||
// ResetLabelAllowLists resets the label allow list for the TimingHistogramVec.
|
||||
// NOTE: This should only be used in test.
|
||||
func (v *TimingHistogramVec) ResetLabelAllowLists() {
|
||||
v.initializeLabelAllowListsOnce = sync.Once{}
|
||||
v.LabelValueAllowLists = nil
|
||||
}
|
||||
|
||||
// WithContext returns wrapped TimingHistogramVec with context
|
||||
func (v *TimingHistogramVec) InterfaceWithContext(ctx context.Context) GaugeVecMetric {
|
||||
return &TimingHistogramVecWithContext{
|
||||
|
Reference in New Issue
Block a user