Add --timings phase logs and named-env deploys #3
Reference in New Issue
Block a user
Delete Branch "benvin/timings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Slow deploys give no hint where the time goes, and
deploy <env>touched environments it was not asked for.--timings: one slogtimingline per phase (lock, source, env, module, gc, run summary) withdurcache=hit,missorshared; keep unfinished flights across concurrent Deploys-jslot and worktree lock waits aswaiton leaf phases onlyfailedin the run summarygentypes.Generatecounts asStatsTestNamedDeployRevivedWorktreeKeepsGracebelow; passes on base, fails here; module dirs too) → on a named deploy, drop gc marks for the swapped-in worktree and its module dirsaddWaitadds every goroutine's slot wait to all ancestors, sorun/env.totalwait is summed across goroutines (seenrun: wait 1.12s, dur 250msat-j1, 9 envs) → add wait only to the innermost span, or rename it so it is not read as wall time--timings+gentypes.StatsMatches, filteredEnvironments, skip purge/GC) + completion. Completion is also not in the whymodule.downloaddur excludes wait, but every other phase's dur includes it → make them consistentpresent(dir)stats every git module even with--timingsoff → only compute it whend.Timings != nilAdd --timings phase logs and scope named deploysto Add --timings phase logsonceis labelledcache=hitthough itsduris the leader's work (cold cachedir:module.fetch module=bind cache=hit dur=32ms); same at :539, :555, :591 → label followerscache=shared(ormiss); keephitfor "already complete before this run"s.wait.Add(timing.go) and inverting the :539/:591 labels both passTestTimings*;waits == 0(:866) passes on all-0swaits → assert a non-zerowaiton aphase()leaf at-j1, and per-modulemisson a cold run /hiton a warm runmodule.resolvecache label is "module dir already complete", not a resolve cache (rev-parse always runs), duplicatingmodule.worktree→ drop itdeployEnvis countedoutcome=unchanged(defer runs before the recover in deploySource,errstill nil); source fetch/branch errors never reachfailed→ count failures where they are recovered/returnedclear(d.flights)drops in-flight entries, so a concurrentDeployon the same Deployer redoes work already in flight (repro below: module mirror fetched 2x; passes on the base branch). It is also an unlisted behaviour change with timings off → prune only completed flights (maps.DeleteFuncon<-f.done), add the repro test, list the change in the PR body.env=),d.count("removed")removed (deploy.go:757),g.marked++/g.removed++removed (deploy.go:798/812),--timingsnot wired (main.go:49) → assertenv=on module.* lines, the removed/marked counts, and the flag wiring.worked: false, which labels a panicking flightcache=hit→ assertcache=missfor a panicking module.dur, notwait, so a serializedenv.worktreelooks like slow git → add it towait.Repro (internal/deploy, fails at
4edc423):Add --timings phase logsto Add --timings phase logs and named-env deploys