Bump k8s.io deps to v0.25.3
Signed-off-by: Luca Comellini <luca.com@gmail.com>
This commit is contained in:
		
							
								
								
									
										49
									
								
								vendor/k8s.io/component-base/metrics/opts.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										49
									
								
								vendor/k8s.io/component-base/metrics/opts.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -24,6 +24,7 @@ import ( | ||||
|  | ||||
| 	"github.com/prometheus/client_golang/prometheus" | ||||
| 	"k8s.io/apimachinery/pkg/util/sets" | ||||
| 	promext "k8s.io/component-base/metrics/prometheusextension" | ||||
| ) | ||||
|  | ||||
| var ( | ||||
| @@ -189,6 +190,54 @@ func (o *HistogramOpts) toPromHistogramOpts() prometheus.HistogramOpts { | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // TimingHistogramOpts bundles the options for creating a TimingHistogram metric. It is | ||||
| // mandatory to set Name to a non-empty string. All other fields are optional | ||||
| // and can safely be left at their zero value, although it is strongly | ||||
| // encouraged to set a Help string. | ||||
| type TimingHistogramOpts struct { | ||||
| 	Namespace            string | ||||
| 	Subsystem            string | ||||
| 	Name                 string | ||||
| 	Help                 string | ||||
| 	ConstLabels          map[string]string | ||||
| 	Buckets              []float64 | ||||
| 	InitialValue         float64 | ||||
| 	DeprecatedVersion    string | ||||
| 	deprecateOnce        sync.Once | ||||
| 	annotateOnce         sync.Once | ||||
| 	StabilityLevel       StabilityLevel | ||||
| 	LabelValueAllowLists *MetricLabelAllowList | ||||
| } | ||||
|  | ||||
| // Modify help description on the metric description. | ||||
| func (o *TimingHistogramOpts) markDeprecated() { | ||||
| 	o.deprecateOnce.Do(func() { | ||||
| 		o.Help = fmt.Sprintf("(Deprecated since %v) %v", o.DeprecatedVersion, o.Help) | ||||
| 	}) | ||||
| } | ||||
|  | ||||
| // annotateStabilityLevel annotates help description on the metric description with the stability level | ||||
| // of the metric | ||||
| func (o *TimingHistogramOpts) annotateStabilityLevel() { | ||||
| 	o.annotateOnce.Do(func() { | ||||
| 		o.Help = fmt.Sprintf("[%v] %v", o.StabilityLevel, o.Help) | ||||
| 	}) | ||||
| } | ||||
|  | ||||
| // convenience function to allow easy transformation to the prometheus | ||||
| // counterpart. This will do more once we have a proper label abstraction | ||||
| func (o *TimingHistogramOpts) toPromHistogramOpts() promext.TimingHistogramOpts { | ||||
| 	return promext.TimingHistogramOpts{ | ||||
| 		Namespace:    o.Namespace, | ||||
| 		Subsystem:    o.Subsystem, | ||||
| 		Name:         o.Name, | ||||
| 		Help:         o.Help, | ||||
| 		ConstLabels:  o.ConstLabels, | ||||
| 		Buckets:      o.Buckets, | ||||
| 		InitialValue: o.InitialValue, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // SummaryOpts bundles the options for creating a Summary metric. It is | ||||
| // mandatory to set Name to a non-empty string. While all other fields are | ||||
| // optional and can safely be left at their zero value, it is recommended to set | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Luca Comellini
					Luca Comellini