Skip to content

Commit 9bd730a

Browse files
committed
test: require prefilter timing metrics on materializing scans
1 parent abba808 commit 9bd730a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎tests/c_api_test.rs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8165,6 +8165,18 @@ fn test_scanner_nearest_segment_prefilter_statistics() {
81658165
"unexpected {name} for a complete unfiltered segment"
81668166
);
81678167
}
8168+
} else {
8169+
// An absent metric also sums to zero above. Materializing cases
8170+
// must expose both timers, even when their durations are zero.
8171+
for name in ["prefilter_build_time", "prefilter_load_time"] {
8172+
assert!(
8173+
captured.metrics.iter().any(|(metric, kind, _)| {
8174+
metric == name && *kind == LanceScanMetricKind::TimeNanoseconds
8175+
}),
8176+
"missing prefilter timing: {name}: {:?}",
8177+
captured.metrics
8178+
);
8179+
}
81688180
}
81698181
unsafe { lance_scanner_close(scanner) };
81708182
}

0 commit comments

Comments
 (0)