|
|
|
|
@ -458,6 +458,8 @@ func (w *Writer) AddSeries(ref storage.SeriesRef, lset labels.Labels, chunks ... |
|
|
|
|
c := chunks[0] |
|
|
|
|
w.buf2.PutVarint64(c.MinTime) |
|
|
|
|
w.buf2.PutUvarint64(uint64(c.MaxTime - c.MinTime)) |
|
|
|
|
w.buf2.PutUvarint64(c.Bytes) |
|
|
|
|
w.buf2.PutUvarint32(c.Entries) |
|
|
|
|
w.buf2.PutBE32(c.Checksum) |
|
|
|
|
t0 := c.MaxTime |
|
|
|
|
|
|
|
|
|
@ -466,6 +468,8 @@ func (w *Writer) AddSeries(ref storage.SeriesRef, lset labels.Labels, chunks ... |
|
|
|
|
// instead of uvarint because chunks may overlap
|
|
|
|
|
w.buf2.PutVarint64(c.MinTime - t0) |
|
|
|
|
w.buf2.PutUvarint64(uint64(c.MaxTime - c.MinTime)) |
|
|
|
|
w.buf2.PutUvarint64(c.Bytes) |
|
|
|
|
w.buf2.PutUvarint32(c.Entries) |
|
|
|
|
t0 = c.MaxTime |
|
|
|
|
|
|
|
|
|
w.buf2.PutBE32(c.Checksum) |
|
|
|
|
@ -1865,12 +1869,16 @@ func (dec *Decoder) Series(b []byte, lbls *labels.Labels, chks *[]ChunkMeta) err |
|
|
|
|
|
|
|
|
|
t0 := d.Varint64() |
|
|
|
|
maxt := int64(d.Uvarint64()) + t0 |
|
|
|
|
nBytes := d.Uvarint64() |
|
|
|
|
entries := uint32(d.Uvarint64()) |
|
|
|
|
checksum := d.Be32() |
|
|
|
|
|
|
|
|
|
*chks = append(*chks, ChunkMeta{ |
|
|
|
|
Checksum: checksum, |
|
|
|
|
MinTime: t0, |
|
|
|
|
MaxTime: maxt, |
|
|
|
|
Bytes: nBytes, |
|
|
|
|
Entries: entries, |
|
|
|
|
}) |
|
|
|
|
t0 = maxt |
|
|
|
|
|
|
|
|
|
@ -1879,6 +1887,8 @@ func (dec *Decoder) Series(b []byte, lbls *labels.Labels, chks *[]ChunkMeta) err |
|
|
|
|
// instead of uvarint because chunks may overlap
|
|
|
|
|
mint := d.Varint64() + t0 |
|
|
|
|
maxt := int64(d.Uvarint64()) + mint |
|
|
|
|
nBytes := d.Uvarint64() |
|
|
|
|
entries := uint32(d.Uvarint64()) |
|
|
|
|
checksum := d.Be32() |
|
|
|
|
t0 = maxt |
|
|
|
|
|
|
|
|
|
@ -1890,6 +1900,8 @@ func (dec *Decoder) Series(b []byte, lbls *labels.Labels, chks *[]ChunkMeta) err |
|
|
|
|
Checksum: checksum, |
|
|
|
|
MinTime: mint, |
|
|
|
|
MaxTime: maxt, |
|
|
|
|
Bytes: nBytes, |
|
|
|
|
Entries: entries, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
return d.Err() |
|
|
|
|
|