lib/promscrape: fix BenchmarkScrapeWorkScrapeInternal, which has been broken by the commit 65bc460323

This commit is contained in:
Aliaksandr Valialkin 2024-01-30 16:05:36 +02:00
parent 7007c6a760
commit c2373a8109
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB

View file

@ -83,6 +83,7 @@ vm_tcplistener_write_calls_total{name="https", addr=":443"} 132356
sw.Config = &ScrapeWork{} sw.Config = &ScrapeWork{}
sw.ReadData = readDataFunc sw.ReadData = readDataFunc
sw.PushData = func(at *auth.Token, wr *prompbmarshal.WriteRequest) {} sw.PushData = func(at *auth.Token, wr *prompbmarshal.WriteRequest) {}
tsmGlobal.Register(&sw)
timestamp := int64(0) timestamp := int64(0)
for pb.Next() { for pb.Next() {
if err := sw.scrapeInternal(timestamp, timestamp); err != nil { if err := sw.scrapeInternal(timestamp, timestamp); err != nil {
@ -90,5 +91,6 @@ vm_tcplistener_write_calls_total{name="https", addr=":443"} 132356
} }
timestamp++ timestamp++
} }
tsmGlobal.Unregister(&sw)
}) })
} }