@@ -60,7 +60,7 @@ func BenchmarkMarshallWriteRequestV2(b *testing.B) {
60
60
lbs := labels .FromStrings (labels .MetricName , "foo" , "labelName1" , "labelValue1" , "labelName2" , "labelValue2" , "labelName3" , "labelValue3" )
61
61
st .SymbolizeLabels (lbs , nil )
62
62
symbols := st .Symbols ()
63
- for i := 0 ; i < numOfSeries ; i ++ {
63
+ for i := range numOfSeries {
64
64
ts = append (ts , PreallocTimeseriesV2 {TimeSeriesV2 : TimeseriesV2FromPool ()})
65
65
ts [i ].LabelsRefs = []uint32 {1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 }
66
66
ts [i ].Samples = []Sample {{Value : 1 , TimestampMs : 2 }}
@@ -69,14 +69,14 @@ func BenchmarkMarshallWriteRequestV2(b *testing.B) {
69
69
tests := []struct {
70
70
name string
71
71
writeRequestFactory func () proto.Marshaler
72
- clean func (in interface {} )
72
+ clean func (in any )
73
73
}{
74
74
{
75
75
name : "no-pool" ,
76
76
writeRequestFactory : func () proto.Marshaler {
77
77
return & WriteRequestV2 {Symbols : symbols , Timeseries : ts }
78
78
},
79
- clean : func (in interface {} ) {},
79
+ clean : func (in any ) {},
80
80
},
81
81
{
82
82
name : "byte pool" ,
@@ -86,7 +86,7 @@ func BenchmarkMarshallWriteRequestV2(b *testing.B) {
86
86
w .Symbols = symbols
87
87
return w
88
88
},
89
- clean : func (in interface {} ) {
89
+ clean : func (in any ) {
90
90
ReuseWriteRequestV2 (in .(* PreallocWriteRequestV2 ))
91
91
},
92
92
},
@@ -98,15 +98,15 @@ func BenchmarkMarshallWriteRequestV2(b *testing.B) {
98
98
w .Symbols = symbols
99
99
return w
100
100
},
101
- clean : func (in interface {} ) {
101
+ clean : func (in any ) {
102
102
ReuseWriteRequestV2 (in .(* PreallocWriteRequestV2 ))
103
103
},
104
104
},
105
105
}
106
106
107
107
for _ , tc := range tests {
108
108
b .Run (tc .name , func (b * testing.B ) {
109
- for i := 0 ; i < b . N ; i ++ {
109
+ for b . Loop () {
110
110
w := tc .writeRequestFactory ()
111
111
_ , err := w .Marshal ()
112
112
require .NoError (b , err )
0 commit comments