VictoriaMetrics/lib/storage/raw_block.go

24 lines
505 B
Go
Raw Normal View History

2019-05-22 23:16:55 +02:00
package storage
// rawBlock represents a raw block of a single time-series rows.
type rawBlock struct {
TSID TSID
Timestamps []int64
Values []float64
}
// Reset resets rb.
func (rb *rawBlock) Reset() {
rb.TSID = TSID{}
rb.Timestamps = rb.Timestamps[:0]
rb.Values = rb.Values[:0]
}
// CopyFrom copies src to rb.
func (rb *rawBlock) CopyFrom(src *rawBlock) {
rb.TSID = src.TSID
rb.Timestamps = append(rb.Timestamps[:0], src.Timestamps...)
rb.Values = append(rb.Values[:0], src.Values...)
}