tsdb documenation: More details about chunks

Signed-off-by: Antoine Pultier <45740+fungiboletus@users.noreply.github.com>
pull/14826/head
Antoine Pultier 2024-09-04 14:57:30 +02:00 committed by GitHub
parent 6ef1eb4e68
commit f5971bf292
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 5 deletions

View File

@ -29,15 +29,16 @@ in-file offset (lower 4 bytes) and segment sequence number (upper 4 bytes).
# Chunk
```
┌───────────────┬───────────────────┬──────────────┬────────────────┐
│ len <uvarint> │ encoding <1 byte> │ data <bytes> │ CRC32 <4 byte>
└───────────────┴───────────────────┴──────────────┴────────────────┘
┌───────────────┬───────────────────┬──────────────┬────────────────
│ len <uvarint> │ encoding <1 byte> │ data <bytes> │ CRC32C <4 byte>
└───────────────┴───────────────────┴──────────────┴────────────────
```
Notes:
* `<uvarint>` has 1 to 10 bytes.
* `encoding`: Currently either `XOR` or `histogram`.
* `<uvarint>` has 1 to 10 bytes, from [`encoding/binary`](https://go.dev/src/encoding/binary/varint.go).
* `encoding`: Currently either `XOR` (1), `histogram` (2), or `float histogram` (3).
* `data`: See below for each encoding.
* `CRC32C`: CRC32 Castagnoli of `encoding` and `data`, serialised as an unsigned 32 bits big endian.
## XOR chunk data