mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-20 23:46:23 +01:00
26 lines
467 B
Go
26 lines
467 B
Go
|
package prompb
|
||
|
|
||
|
// Reset resets wr.
|
||
|
func (wr *WriteRequest) Reset() {
|
||
|
for i := range wr.Timeseries {
|
||
|
ts := &wr.Timeseries[i]
|
||
|
ts.Labels = nil
|
||
|
ts.Samples = nil
|
||
|
}
|
||
|
wr.Timeseries = wr.Timeseries[:0]
|
||
|
|
||
|
for i := range wr.labelsPool {
|
||
|
lb := &wr.labelsPool[i]
|
||
|
lb.Name = nil
|
||
|
lb.Value = nil
|
||
|
}
|
||
|
wr.labelsPool = wr.labelsPool[:0]
|
||
|
|
||
|
for i := range wr.samplesPool {
|
||
|
s := &wr.samplesPool[i]
|
||
|
s.Value = 0
|
||
|
s.Timestamp = 0
|
||
|
}
|
||
|
wr.samplesPool = wr.samplesPool[:0]
|
||
|
}
|