@@ -44,7 +44,7 @@ func (s *Set) NewSetVecWithTTL(label string, ttl time.Duration) *SetVec {
44
44
return sv
45
45
}
46
46
47
- // WithLabelValues returns the Set for the corresponding label value.
47
+ // WithLabelValue returns the Set for the corresponding label value.
48
48
// If the combination of values is seen for the first time, a new Set
49
49
// is created.
50
50
//
@@ -53,20 +53,20 @@ func (s *Set) NewSetVecWithTTL(label string, ttl time.Duration) *SetVec {
53
53
// the returned Set alive if necessary.
54
54
//
55
55
// See [Set.KeepAlive] to manually keep a specific Set alive.
56
- func (s * SetVec ) WithLabelValue (value string ) * Set {
57
- hash := hashFinish (s .partialHash , value )
56
+ func (sv * SetVec ) WithLabelValue (value string ) * Set {
57
+ hash := hashFinish (sv .partialHash , value )
58
58
59
- set , ok := s .s .setsByHash .Load (hash )
59
+ set , ok := sv .s .setsByHash .Load (hash )
60
60
if ! ok {
61
- set = s .s .loadOrStoreSetFromVec (hash , s .ttl , s .label , value )
61
+ set = sv .s .loadOrStoreSetFromVec (hash , sv .ttl , sv .label , value )
62
62
}
63
63
set .KeepAlive ()
64
64
return set
65
65
}
66
66
67
67
// RemoveByLabelValue removes the Set for the corresponding label value.
68
- func (s * SetVec ) RemoveByLabelValue (value string ) {
69
- s .s .setsByHash .Delete (hashFinish (s .partialHash , value ))
68
+ func (sv * SetVec ) RemoveByLabelValue (value string ) {
69
+ sv .s .setsByHash .Delete (hashFinish (sv .partialHash , value ))
70
70
}
71
71
72
72
// NewUint64Vec creates a new [Uint64Vec] with the supplied name.
@@ -83,13 +83,13 @@ func (sv *SetVec) NewUint64Vec(family string, labels ...string) *Uint64Vec {
83
83
// The returned Uint64 is safe to use from concurrent goroutines.
84
84
//
85
85
// This will panic if values are invalid or already registered.
86
- func (s * SetVec ) NewUint64 (family string , value string , tags ... string ) * Uint64 {
87
- return s .WithLabelValue (value ).NewUint64 (family , tags ... )
86
+ func (sv * SetVec ) NewUint64 (family string , value string , tags ... string ) * Uint64 {
87
+ return sv .WithLabelValue (value ).NewUint64 (family , tags ... )
88
88
}
89
89
90
90
// NewCounter is an alias for [SetVec.NewUint64].
91
- func (s * SetVec ) NewCounter (family string , value string , tags ... string ) * Uint64 {
92
- return s .WithLabelValue (value ).NewCounter (family , tags ... )
91
+ func (sv * SetVec ) NewCounter (family string , value string , tags ... string ) * Uint64 {
92
+ return sv .WithLabelValue (value ).NewCounter (family , tags ... )
93
93
}
94
94
95
95
// NewInt64Vec creates a new [Int64Vec] with the supplied name.
@@ -106,8 +106,8 @@ func (sv *SetVec) NewInt64Vec(family string, labels ...string) *Int64Vec {
106
106
// The returned Int64 is safe to use from concurrent goroutines.
107
107
//
108
108
// This will panic if values are invalid or already registered.
109
- func (s * SetVec ) NewInt64 (family string , value string , tags ... string ) * Int64 {
110
- return s .WithLabelValue (value ).NewInt64 (family , tags ... )
109
+ func (sv * SetVec ) NewInt64 (family string , value string , tags ... string ) * Int64 {
110
+ return sv .WithLabelValue (value ).NewInt64 (family , tags ... )
111
111
}
112
112
113
113
// NewFloat64Vec creates a new [Float64Vec] with the supplied name.
@@ -124,8 +124,8 @@ func (sv *SetVec) NewFloat64Vec(family string, labels ...string) *Float64Vec {
124
124
// The returned Float64 is safe to use from concurrent goroutines.
125
125
//
126
126
// This will panic if values are invalid or already registered.
127
- func (s * SetVec ) NewFloat64 (family string , value string , tags ... string ) * Float64 {
128
- return s .WithLabelValue (value ).NewFloat64 (family , tags ... )
127
+ func (sv * SetVec ) NewFloat64 (family string , value string , tags ... string ) * Float64 {
128
+ return sv .WithLabelValue (value ).NewFloat64 (family , tags ... )
129
129
}
130
130
131
131
// NewFixedHistogram creates and returns new FixedHistogram using the label from the SetVec.
@@ -137,16 +137,16 @@ func (s *SetVec) NewFloat64(family string, value string, tags ...string) *Float6
137
137
// The returned FixedHistogram is safe to use from concurrent goroutines.
138
138
//
139
139
// This will panic if values are invalid or already registered.
140
- func (s * SetVec ) NewFixedHistogram (family string , buckets []float64 , value string , tags ... string ) * FixedHistogram {
141
- return s .WithLabelValue (value ).NewFixedHistogram (family , buckets , tags ... )
140
+ func (sv * SetVec ) NewFixedHistogram (family string , buckets []float64 , value string , tags ... string ) * FixedHistogram {
141
+ return sv .WithLabelValue (value ).NewFixedHistogram (family , buckets , tags ... )
142
142
}
143
143
144
144
// NewFixedHistogramVec creates a new [FixedHistogramVec] with the supplied opt.
145
- func (s * SetVec ) NewFixedHistogramVec (family string , buckets []float64 , labels ... string ) * FixedHistogramVec {
145
+ func (sv * SetVec ) NewFixedHistogramVec (family string , buckets []float64 , labels ... string ) * FixedHistogramVec {
146
146
buckets = getBuckets (buckets )
147
147
148
148
return & FixedHistogramVec {
149
- commonVec : getCommonVecSetVec (s , family , labels ),
149
+ commonVec : getCommonVecSetVec (sv , family , labels ),
150
150
buckets : buckets ,
151
151
labels : labelsForBuckets (buckets ),
152
152
}
@@ -161,8 +161,8 @@ func (s *SetVec) NewFixedHistogramVec(family string, buckets []float64, labels .
161
161
// The returned Histogram is safe to use from concurrent goroutines.
162
162
//
163
163
// This will panic if values are invalid or already registered.
164
- func (s * SetVec ) NewHistogram (family string , value string , tags ... string ) * Histogram {
165
- return s .WithLabelValue (value ).NewHistogram (family , tags ... )
164
+ func (sv * SetVec ) NewHistogram (family string , value string , tags ... string ) * Histogram {
165
+ return sv .WithLabelValue (value ).NewHistogram (family , tags ... )
166
166
}
167
167
168
168
// NewHistogramVec creates a new [HistogramVec] with the supplied name.
0 commit comments