Enhance logging for VFS directory watching

- Added timing measurement for the selective watching process in the `ServeSession` implementation, improving visibility into performance during directory watching.
- Updated the debug log message to include the elapsed time for better monitoring of the watching behavior.

These changes aim to provide more detailed insights into the VFS's directory watching performance.
This commit is contained in:
Joe 2026-03-06 17:56:04 -06:00
parent a1825f7c4a
commit a1b65dbb52

View file

@ -309,6 +309,7 @@ impl ServeSession {
apply_patch_set(&mut tree, patch_set);
log::debug!("Patch computed + applied in {:.1?}", patch_start.elapsed());
let watch_start = Instant::now();
if let Some(recorded_paths) = vfs.take_recorded_paths() {
let dir_count = recorded_paths.iter().filter(|p| p.is_dir()).count();
for path in &recorded_paths {
@ -326,8 +327,9 @@ impl ServeSession {
let _ = vfs.watch(root);
}
log::debug!(
"Selective watching: {} directories watched (non-recursive)",
"Selective watching: {} directories watched (non-recursive) in {:.1?}",
dir_count + path_roots.len(),
watch_start.elapsed(),
);
}