Expand description
Delta codec for monotonic counter columns.
Monotonic counters (bytes_sent, request_count) have small positive deltas that compress well with simple delta encoding + varint packing.
Wire format:
[4 bytes] sample count (LE u32)
[8 bytes] first value (LE i64)
[N bytes] varint-encoded deltas (ZigZag + LEB128)Varint encoding uses ZigZag to handle negative deltas (counter resets) efficiently: small absolute values → 1-2 bytes regardless of sign.
Compression: monotonic counters with small increments → ~1-2 bytes/sample. Non-monotonic data → ~2-4 bytes/sample (still better than raw 8 bytes).
Structs§
- Delta
Decoder - Streaming Delta decoder.
- Delta
Encoder - Streaming Delta encoder. Accumulates values and produces compressed
bytes on
finish().