Enhance logging with detailed timing information for API and session operations

- Added timing logs to various functions in `ApiContext`, `ServeSession`, and `Reconciler` to track performance and improve debugging.
- Introduced detailed trace logs for connection, reading, writing, and patch application processes, providing insights into execution times.
- Updated the `App` component to log the patch tree building process, enhancing visibility during session startup.

These changes aim to improve performance monitoring and facilitate troubleshooting within the application.
This commit is contained in:
Joe 2026-03-01 14:07:47 -06:00
parent a0e07bb542
commit 7b9d44953b
6 changed files with 223 additions and 15 deletions

View file

@ -1002,14 +1002,14 @@ function App:startSession()
self:setState({
connectingText = "Computing diff view...",
})
local patchTreeClock = os.clock()
Log.trace("[TIMING] PatchTree.build() starting")
local patchTree =
PatchTree.build(patch, instanceMap, { "Property", "Current", "Incoming" }, serverInfo.gitMetadata)
Log.trace("[TIMING] PatchTree.build() completed ({:.1} ms)", (os.clock() - patchTreeClock) * 1000)
self:setState({
appStatus = AppStatus.Confirming,
patchTree = PatchTree.build(
patch,
instanceMap,
{ "Property", "Current", "Incoming" },
serverInfo.gitMetadata
),
patchTree = patchTree,
confirmData = {
serverInfo = serverInfo,
},
@ -1021,6 +1021,7 @@ function App:startSession()
timeout = 7,
})
Log.trace("[TIMING] Waiting for user to confirm/reject patch...")
local result = self.confirmationEvent:Wait()
-- One-shot sync: Don't transition to Connected UI