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 8958fb78ad
commit 645365b2d1
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.ReadData = readDataFunc
sw.PushData = func(at *auth.Token, wr *prompbmarshal.WriteRequest) {}
tsmGlobal.Register(&sw)
timestamp := int64(0)
for pb.Next() {
if err := sw.scrapeInternal(timestamp, timestamp); err != nil {
@ -90,5 +91,6 @@ vm_tcplistener_write_calls_total{name="https", addr=":443"} 132356
}
timestamp++
}
tsmGlobal.Unregister(&sw)
})
}