From a1b65dbb524822f99f30d7fa77e8d57a21f30cc2 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 6 Mar 2026 17:56:04 -0600 Subject: [PATCH] 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. --- src/serve_session.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/serve_session.rs b/src/serve_session.rs index c04afa92..587f2456 100644 --- a/src/serve_session.rs +++ b/src/serve_session.rs @@ -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(), ); }