Repository navigation
Conversation
Move the export request, media-type and row-version checks and the horizon and cursor headers out of `proofline export` into export_page, so another command can follow the continuation with the same checks. `proofline export` prints exactly what it printed before.
`proofline stats --from FROM --to TO` reads every page of the reviews export for one window and prints, per repository and in total, the reviews by status and the nearest-rank p50, p90, p99 and longest time from creation to completion of the completed reviews. --json prints the same report with times in seconds. The report is printed only after the last page. A page that fails, a settled horizon that changes between pages or a continuation cursor that repeats exits 1 with no partial report, and the walk is bounded at 10,000 pages.
Author
|
The |
The reviews export mixes pull-request, deployment, local patch, commit, named-file, merge-group and revision-scan reviews. Mixing them skews the turnaround authors wait for, and revision scans currently end FAILED or INCOMPLETE, so they inflate the failed count. stats now counts pull_request reviews unless a repeatable --kind selects others, and reports the kinds it counted and how many reviews it left out. Repository names are display data, so reviews now group by the stable repository ID and show its current name, falling back to the name and then '(no repository)' when the review records no ID.
Author
|
I pushed 439686b. |
This branch has not been deployed
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.
Who this helps
An engineering lead or platform owner who has rolled Proofline out across many repositories, and needs answers to two questions: how long do authors wait for a review, and how often does a review fail to give them a usable result? Today the CLI can only answer that with a shell loop. You would run
proofline export reviewspage by page, carry--cursoralong by hand, check that the settled horizon stays the same, strip repeated headers, and then compute percentiles withjqor a spreadsheet. The README itself warns against treating partial output from several invocations as a complete export.proofline statsdoes that whole job in one command. This is the real output against the synthetic 200,000-review export described under verification:--jsonprints the same report with times in seconds, for dashboards and CI checks such as "fail if p90 turnaround goes above 15 minutes".What it does
reviewsexport for the window. It needsanalytics:readand the server's 31-day window limit, and adds no new API.--kindto choose others:pull_request,deployment,patch,commit,files,merge_grouporrevision_scan. Stderr and the JSON report say which kinds were counted and how many reviews were left out.allrow. Each row shows reviews by status:completed,incomplete,failed,unfinished(pending or running) andother. It also shows the nearest-rank p50 / p90 / p99 / max time fromcreated_attocompleted_at.Decisions
--kindsays otherwiseFAILEDorINCOMPLETE. Mixing them in would inflate the failed count and skew "how long authors wait". The default answers the pull-request question, and--kindopts others in.repository_id, showrepository_full_name(no repository).COMPLETEDreviewsu64per completed review is about 8 MB for a million reviews, so a sketch isn't needed yet.other, unreadable times are refusedexport_pagehelper (separate refactor commit)statsreuses exactly the media-type, row-version, horizon and cursor checks thatproofline exportalready applies, instead of a second copy.exportprints byte-for-byte what it did before. The only difference is that an unreadablenext-cursorheader is now refused before the page is printed, instead of after.github_actions::unix_secondscargo denyis unaffected.How I verified it
tests/stats.rsfirst and watched it fail, because the subcommand didn't exist yet. The tests run the real binary against a loopback stand-in for the console:--kind pull_request --kind patchallsrc/stats.rs: percentile ranks (1..100 gives 50/90/99/100, a single value, empty input), duration formatting at every scale, turnaround only forCOMPLETED, clock skew clamped to 0, an unreadable time refused, the repository name fallback, and unknown statuses counted asother, grouping by ID and never by name when an ID exists, and every--kindvalue mapping to the export's spelling.4m04s / 11m22s / 26m11s / 2h03m).cargo fmt --checkandcargo clippy --locked --all-targets -- -D warningsare clean, andcargo test --locked --no-fail-fastpasses. The one failure,agent_install'sunattended_registration_…, is the existing macOS/varvs/private/varissue unattended_registration_preserves_settings_and_uses_the_installed_binary fails on macOS (/var vs /private/var) #112. It fails the same way onmain.Out of scope
statscan build on it once that lands.--trigger-originfilter or breakdown, for example automatic runs vsRERUN, to see how much of the wait is reruns. It fits in the same row filter as--kind.spenddataset.