Skip to main content

compact_items

Function compact_items 

Source
pub fn compact_items<S: BuildHasher>(
    events_by_item: &BTreeMap<String, Vec<Event>>,
    agent: &str,
    min_age_days: u32,
    now_us: i64,
    redacted_hashes: &HashSet<String, S>,
) -> (Vec<Event>, CompactionReport)
Expand description

Compact eligible items from a collection of events grouped by item ID.

§Arguments

  • events_by_item — Map from item_id to all events for that item.
  • agent — Agent identifier for snapshot events.
  • min_age_days — Minimum days in done/archived before compaction.
  • now_us — Current wall-clock time in microseconds.
  • redacted_hashes — Set of event hashes that have been redacted.

§Returns

A tuple of (snapshot_events, report).