From f5971bf292aa40547e0ba1a718212493a76382b4 Mon Sep 17 00:00:00 2001 From: Antoine Pultier <45740+fungiboletus@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:57:30 +0200 Subject: [PATCH] tsdb documenation: More details about chunks Signed-off-by: Antoine Pultier <45740+fungiboletus@users.noreply.github.com> --- tsdb/docs/format/chunks.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tsdb/docs/format/chunks.md b/tsdb/docs/format/chunks.md index 8318e0a540..8a35721358 100644 --- a/tsdb/docs/format/chunks.md +++ b/tsdb/docs/format/chunks.md @@ -29,15 +29,16 @@ in-file offset (lower 4 bytes) and segment sequence number (upper 4 bytes). # Chunk ``` -┌───────────────┬───────────────────┬──────────────┬────────────────┐ -│ len │ encoding <1 byte> │ data │ CRC32 <4 byte> │ -└───────────────┴───────────────────┴──────────────┴────────────────┘ +┌───────────────┬───────────────────┬──────────────┬─────────────────┐ +│ len │ encoding <1 byte> │ data │ CRC32C <4 byte> │ +└───────────────┴───────────────────┴──────────────┴─────────────────┘ ``` Notes: -* `` has 1 to 10 bytes. -* `encoding`: Currently either `XOR` or `histogram`. +* `` 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