Skip to main content

global_zone_line_count

Function global_zone_line_count 

Source
pub(super) fn global_zone_line_count(
    gfs: &Arc<FileStore>,
    zone: &str,
) -> Option<u64>
Expand description

Exact non-blank line count of the output file in zone, computed via the same streaming index builder read_range uses (so the two endpoints always agree). Returns Some(0) for an empty file, None on read failure.

Reuses output.idx when its covered_size header already matches the current output size — same freshness check register_blockfile_read_range (blockfile.rs) already does — instead of unconditionally rescanning the entire history on every call. Without this, every pane open for an agent with any global-zone history pays a full O(history size) rescan even when nothing has changed since the index was last built.