Encode a slice of f64 values using Gorilla XOR compression. Uses synthetic sequential timestamps (0, 1, 2, ...) so the timestamp channel compresses to near-zero overhead.
(values: &[f64])
| 314 | /// Uses synthetic sequential timestamps (0, 1, 2, ...) so the timestamp |
| 315 | /// channel compresses to near-zero overhead. |
| 316 | pub fn encode_f64(values: &[f64]) -> Vec<u8> { |
| 317 | let mut enc = GorillaEncoder::new(); |
| 318 | for (i, &v) in values.iter().enumerate() { |
| 319 | enc.encode(i as i64, v); |
| 320 | } |
| 321 | enc.finish() |
| 322 | } |
| 323 | |
| 324 | /// Decode Gorilla-compressed f64 values (encoded with `encode_f64`). |
| 325 | pub fn decode_f64(data: &[u8]) -> Result<Vec<f64>, CodecError> { |