@@ -60,7 +60,7 @@ func BenchmarkMarshallWriteRequestV2(b *testing.B) {
6060 lbs := labels .FromStrings (labels .MetricName , "foo" , "labelName1" , "labelValue1" , "labelName2" , "labelValue2" , "labelName3" , "labelValue3" )
6161 st .SymbolizeLabels (lbs , nil )
6262 symbols := st .Symbols ()
63- for i := 0 ; i < numOfSeries ; i ++ {
63+ for i := range numOfSeries {
6464 ts = append (ts , PreallocTimeseriesV2 {TimeSeriesV2 : TimeseriesV2FromPool ()})
6565 ts [i ].LabelsRefs = []uint32 {1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 }
6666 ts [i ].Samples = []Sample {{Value : 1 , TimestampMs : 2 }}
@@ -69,14 +69,14 @@ func BenchmarkMarshallWriteRequestV2(b *testing.B) {
6969 tests := []struct {
7070 name string
7171 writeRequestFactory func () proto.Marshaler
72- clean func (in interface {} )
72+ clean func (in any )
7373 }{
7474 {
7575 name : "no-pool" ,
7676 writeRequestFactory : func () proto.Marshaler {
7777 return & WriteRequestV2 {Symbols : symbols , Timeseries : ts }
7878 },
79- clean : func (in interface {} ) {},
79+ clean : func (in any ) {},
8080 },
8181 {
8282 name : "byte pool" ,
@@ -86,7 +86,7 @@ func BenchmarkMarshallWriteRequestV2(b *testing.B) {
8686 w .Symbols = symbols
8787 return w
8888 },
89- clean : func (in interface {} ) {
89+ clean : func (in any ) {
9090 ReuseWriteRequestV2 (in .(* PreallocWriteRequestV2 ))
9191 },
9292 },
@@ -98,15 +98,15 @@ func BenchmarkMarshallWriteRequestV2(b *testing.B) {
9898 w .Symbols = symbols
9999 return w
100100 },
101- clean : func (in interface {} ) {
101+ clean : func (in any ) {
102102 ReuseWriteRequestV2 (in .(* PreallocWriteRequestV2 ))
103103 },
104104 },
105105 }
106106
107107 for _ , tc := range tests {
108108 b .Run (tc .name , func (b * testing.B ) {
109- for i := 0 ; i < b . N ; i ++ {
109+ for b . Loop () {
110110 w := tc .writeRequestFactory ()
111111 _ , err := w .Marshal ()
112112 require .NoError (b , err )
0 commit comments