mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 08:23:34 +01:00
using writeRequestCtxPool when delete kubernetes clusters from kubernetes_sd_configs (#3669)
This commit is contained in:
parent
40d524edb8
commit
5ac0f18ca8
@ -773,7 +773,7 @@ func (sw *scrapeWork) sendStaleSeries(lastScrape, currScrape string, timestamp i
|
|||||||
if currScrape != "" {
|
if currScrape != "" {
|
||||||
bodyString = parser.GetRowsDiff(lastScrape, currScrape)
|
bodyString = parser.GetRowsDiff(lastScrape, currScrape)
|
||||||
}
|
}
|
||||||
wc := &writeRequestCtx{}
|
wc := writeRequestCtxPool.Get(sw.prevLabelsLen)
|
||||||
if bodyString != "" {
|
if bodyString != "" {
|
||||||
wc.rows.UnmarshalWithErrLogger(bodyString, sw.logError)
|
wc.rows.UnmarshalWithErrLogger(bodyString, sw.logError)
|
||||||
srcRows := wc.rows.Rows
|
srcRows := wc.rows.Rows
|
||||||
@ -805,6 +805,8 @@ func (sw *scrapeWork) sendStaleSeries(lastScrape, currScrape string, timestamp i
|
|||||||
staleSamplesCreated.Add(len(samples))
|
staleSamplesCreated.Add(len(samples))
|
||||||
}
|
}
|
||||||
sw.pushData(sw.Config.AuthToken, &wc.writeRequest)
|
sw.pushData(sw.Config.AuthToken, &wc.writeRequest)
|
||||||
|
wc.reset()
|
||||||
|
writeRequestCtxPool.Put(wc)
|
||||||
}
|
}
|
||||||
|
|
||||||
var staleSamplesCreated = metrics.NewCounter(`vm_promscrape_stale_samples_created_total`)
|
var staleSamplesCreated = metrics.NewCounter(`vm_promscrape_stale_samples_created_total`)
|
||||||
|
Loading…
Reference in New Issue
Block a user