History miner: extract real per-derivation build times from nix logs #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
The biggest accuracy win (per README roadmap). Add a
nix-estimate minesubcommand producing the--historyJSON ({name: minutes}) from real data.Implementation:
nix log <drv>timestamps where available.nix build --log-format internal-jsonduring a real build and record start/stop per drv.store_name(), merge multiple runs (median), write/update the history file.Fixed and merged to main (commit
837b885). Internal JSON parsing implementation complete; may need reconciliation with real nix log output and builder-arbitrage CRD schema.Validated
parse_internal_jsonagainst a real 427-linenix build --log-format internal-jsoncapture (a remote nixbuild.net build). Confirmed correct: the@nixline prefix is stripped, onlytype==105(actBuild) start/stop pairs are timed (store-copies type 0 and downloads excluded),.drvread fromfields[0], 64-bit activity ids handled, and mine_history correctly reads STDERR with--log-format internal-json. Documented a real gotcha:resultevents reuse the number 105 from a different enum (resProgress) — guarded by theaction=="start"check. Added regression tests with real captured fixtures. No logic change needed; parser was already correct.