()
| 390 | |
| 391 | #[test] |
| 392 | fn compression_vs_raw() { |
| 393 | let values: Vec<i64> = (0..100_000).map(|i| i * 1000).collect(); |
| 394 | let encoded = encode(&values); |
| 395 | let raw_size = values.len() * 8; |
| 396 | let ratio = raw_size as f64 / encoded.len() as f64; |
| 397 | assert!( |
| 398 | ratio > 3.0, |
| 399 | "expected >3x compression for monotonic counter, got {ratio:.1}x" |
| 400 | ); |
| 401 | } |
| 402 | } |