Skip to main content

Module coverage

Module coverage 

Source
Expand description

In-memory coverage and gap analysis over a discrete bucket domain.

This module is intentionally small and generic:

  • It wraps roaring::RoaringBitmap in a Coverage struct.
  • It does not know about timestamps, tables, or storage.
  • Callers are expected to map their own domain (for example, time buckets) into u32 bucket ids.

Typical usage:

use timeseries_table_format::coverage::{Coverage, RoaringBitmap};

// "expected" domain: buckets 0..10
let expected: RoaringBitmap = (0u32..10).collect();

// "present" coverage: everything except bucket 5
let mut present = RoaringBitmap::new();
for b in 0u32..10 {
    if b != 5 {
        present.insert(b);
    }
}

let cov = Coverage::from_bitmap(present);

let missing = cov.missing_points(&expected);
assert!(missing.contains(5));

let ratio = cov.coverage_ratio(&expected);
assert!((ratio - 0.9).abs() < 1e-9);

Modules§

bucket
Helpers for mapping timestamps into discrete bucket ids.
io
Coverage sidecar file management.
layout
Coverage on-disk layout helpers.
serde
Serialization and deserialization of coverage bitmaps.

Structs§

Coverage
In-memory coverage over a discrete set of bucket ids.
RoaringBitmap
A compressed bitmap using the Roaring bitmap compression scheme.

Type Aliases§

Bucket
Type alias for bucket ids used by Coverage.