Repository navigation
feat(diagnostics): say what the app was doing when it froze - #82
Merged
Merged
Conversation
The lag report could say how often git ran and that the UI thread froze, but not why: most freezes showed only nativeRunBlocking, the allocation rate had to be estimated from a GC flag default, and nothing said which repos the watcher kept rescanning. - The perf log reports the allocation rate each minute, split by UI thread, dispatcher workers, watcher threads and the rest; the clipboard report gives the total since launch. - A stall report adds what else was going on: git processes started and running, scans in progress, collections during the stall, and the other threads' stacks, identical ones folded together and idle ones left out. - The vitals include resident memory, so footprint growth can be told apart from heap growth. - The perf log names the busiest watched repos, with their rescans and which folders their events came from. Repos appear by list position and only generic folder names are shown, since reports get posted publicly. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Raman Gupta <rocketraman@gmail.com>
The allocation baseline was taken at launch whether or not collection was on, so switching it on mid-session gave a first reading averaged over the whole session. It is now taken when collection starts, at launch or from Settings, and a reading with no baseline takes one instead of reporting a rate. Clicking Off while GITVANTAGE_PERF=1 forces collection on now does nothing. It used to log "collection switched off" for collection that carried on, and save "off" for the next launch. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Raman Gupta <rocketraman@gmail.com>
A watcher overflow rescans every repo, and those repos filled the busiest-repos list with "events=0", pushing out the one actually churning. The list now shows only repos with events of their own; the overflow already has its own counter. Shares too small to round now read "<1%" rather than "0%", and "1 worktrees" is singular. Also fixes the detekt formatting that failed CI. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Raman Gupta <rocketraman@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The 1.5.0 lag report (see #81) left several numbers that had to be guessed:
NativeTaoBridge.nativeRunBlocking. The UI thread was stuck in native code (AppKit or the allocator), waiting on something another thread held, and the report said nothing about the other threads.What changed
AllocationMeter). For examplealloc 2.6MB/s over 60s (ui 50% · workers 46% · other 3%). The clipboard report gets the total since launch. It uses the per-thread allocation counters and says "unavailable" if the runtime lacks them.gitprocesses started during the stall and running when caught, scans in progress, and collections and GC time during the stall.ThreadSummary). Identical stacks are folded with a count. Idle threads are counted, not printed. A thread waiting in a native call counts as idle unless app code is on its stack, so a worker inforkAndExecstays visible./proc/self/statuson Linux,pson macOS (once a minute, only while collecting).WatchStats): events, rescans, and each folder's share of the events, recorded only while collecting.For review
repo #n (W worktrees), their position in the list, never a path or name.build/,node_modules/,.git/index…); anything else is "(other folder)".model/Activity, whichGitandRepoScannerwrite and the watchdog reads. That keeps the UI layer from reachingGit.Diagnostics.ktjoins the process-spawning allowlist for the macOSpscall, with the reason added to the rule's comment.Thread.getAllStackTraceshas been tried in the native image yet. Both are wrapped so a missing feature reads "unavailable" rather than failing.Verification
VmRSSparsingbuild/, one in a tracked root file). It showed:rssin the vitals.GITVANTAGE_DEBUG_STALL_MS), whose report included the new context line and thread summary.poll, the reference handler) were listed as busy.