Repository navigation
Releases
ghusage v0.2.0
Highlights
- Faster report generation for large caches.
- Pull requests opened for inspection remain available offline without being counted as your own activity.
- Improved cache and coverage handling, including safer migrations for viewed pull requests.
- More reliable date and time handling across reports.
Performance
Report generation for large caches and long periods is faster. On a copy of a real cache (112,850 events, 2,928 pull requests, 388 repositories; 5 warm-up runs, then 50 runs; load + overview, p95):
| Period | Before | 0.2.0 |
|---|---|---|
| 366 days | 137.0 ms | 117.0 ms |
| 3,000 days | 161.8 ms | 132.2 ms |
| 30 days | 65.9 ms | 61.4 ms |
| 7 days | 38.9 ms | 39.1 ms |
On the synthetic benchmark (Apple M4, release build, 100,000 events, cargo bench --bench latency, p50 / p95), the differences from 0.1.6 are within run-to-run variation:
| 0.1.6 | 0.2.0 | Target (p95) | |
|---|---|---|---|
| 100k event aggregation (overview, 1 year) | 57.7 / 60.0 ms | 55.5 / 56.8 ms | ≤ 1000 ms |
| 100k event aggregation (daily, 1 year) | 57.5 / 59.0 ms | 55.4 / 58.6 ms | ≤ 1000 ms |
| Cached 7-day aggregation | 74.3 / 91.4 ms | 76.6 / 78.3 ms | ≤ 200 ms |
| Cached 30-day aggregation | 100.6 / 108.2 ms | 104.3 / 107.7 ms | ≤ 500 ms |
Install
npm install -g ghusage@0.2.0Prebuilt binaries are provided for macOS (Apple Silicon and Intel), Linux (x64 and arm64), and Windows (x64 and arm64).
See the README for setup and usage.
What's Changed
- feat(time): prototype Jiff migration by @tanahiro2010 in #18
- feat(time): complete chrono to jiff migration by @tanahiro2010 in #19
- chore(deps): bump signal-hook from 0.3.18 to 0.4.6 by @dependabot[bot] in #17
- ci: centralize Rust toolchain and dependency checks by @tanahiro2010 in #21
- fix(ci): pin toolchain action with input support by @tanahiro2010 in #22
- ci: add manual CI speed benchmark workflow by @tanahiro2010 in #23
- test: tolerate additional timeout retries on ARM by @tanahiro2010 in #24
- fix(ci): use runner temp path in benchmark workflow by @tanahiro2010 in #25
- fix(ci): support binary-only packages in split benchmark by @tanahiro2010 in #26
- ci: reuse repository toolchain setup across workflows by @tanahiro2010 in #27
- ci: establish workspace lint policy by @tanahiro2010 in #28
- refactor(clippy): apply machine-applicable lint fixes by @tanahiro2010 in #29
- fix(sync): skip copies of commits that commit search finds in other repositories by @yuu61 in #12
- refactor(visibility): restrict unreachable public items by @tanahiro2010 in #30
- refactor: split large application modules by @tanahiro2010 in #31
- refactor: split remaining large modules by @tanahiro2010 in #32
- refactor(tui): split app and ui modules by @tanahiro2010 in #33
- refactor: complete issue 11 structural cleanup by @tanahiro2010 in #41
- feat(domain): model coverage, viewed pull requests, and repository references by @tanahiro2010 in #42
- fix(storage): isolate viewed pull requests from activity by @tanahiro2010 in #44
- chore(ci): complete workspace lint rollout by @tanahiro2010 in #47
- chore(workflow): add pull request merge guidance by @tanahiro2010 in #48
- perf(report): reduce large cache report latency by @tanahiro2010 in #49
- chore(release): prepare 0.2.0 by @tanahiro2010 in #50
- chore(release): release 0.2.0 by @tanahiro2010 in #51
New Contributors
- @dependabot[bot] made their first contribution in #17
- @yuu61 made their first contribution in #12
Full Changelog: v0.1.6...v0.2.0
ghusage 0.1.6
Changes
- JSON: in
diff_stats,additionsanddeletionsare nownullwhen no commit has known line counts (coverage: "unavailable"). Before, they were0, and onlycoverageshowed that the value was unknown rather than zero lines. Partial sums are still numbers, withcoverage: "partial". See JSON output. If a script reads these fields, handlenull.
Performance
No change to the speed of ghusage itself in this release. Measured on Apple M4 (release build, 100,000 events, 50 runs after 5 warm-up runs, cargo bench --bench latency):
| 0.1.5 | 0.1.6 | Target | |
|---|---|---|---|
| Cached 7-day aggregation, p95 | 85 ms | 82 ms | ≤ 200 ms |
| Cached 30-day aggregation, p95 | 118 ms | 106 ms | ≤ 500 ms |
| 100k event aggregation (overview), p95 | 75 ms | 65 ms | ≤ 1000 ms |
The differences are within run-to-run variation (both runs were taken on a busy machine); the code paths are unchanged.
Development
- CI now runs formatting, the benchmarks in test mode and the 100k-event terminal UI test on one Linux runner only, and links Windows tests with
rust-lld. Per-platform release builds run only for pull requests intorelease. A push todevwent from 5.0 to 3.0 minutes.
Install / update
npm install -g ghusage@0.1.6Full changelog: v0.1.5...v0.1.6
What's Changed
- chore: release 0.1.6 by @tanahiro2010 in #10
Full Changelog: v0.1.5...v0.1.6
ghusage 0.1.5
Lines changed by commits and pull requests
ghusage now reports how many lines your commits added and deleted, and each pull request's current diff (#8).
- Reports:
overviewshows Lines changed (your commits).daily,weekly,monthly,yearlyandreposgain+Linesand-Linescolumns, in tables, Markdown and CSV. JSON summaries gaindiff_stats. - Pull requests:
prsgains a Changes column andpra Changes (current snapshot) line, showing the base-to-head diff when the pull request was last synced. In JSON this isdiff. It is a snapshot of the pull request, not changes made in the period, and it is never added to the commit totals. - Terminal UI: line counts on the Overview, Daily and Repositories screens, PR Detail, and the pull request commit list.
- Fetching:
- Line counts of pull request commits and pull request diffs come with the pull request query, at no extra request.
ghusage sync --diff-statsfetches the line counts still missing for your other commits in the period, 100 commits per GraphQL request, in parallel. About 1,100 commits took about 12 requests.- Counts already stored are never fetched again.
- Honest totals:
- Unknown line counts are never treated as zero. A sum over only some commits is marked (
~in tables,coverage: "partial"in JSON), and one with no known counts shows?. - Merge commits are left out of the totals, because GitHub reports them against their first parent.
- Commits whose changes reach the default branch as other commits are left out too, so the same change is not counted twice. These are commits that exist only in pull requests merged by squash or rebase, and commits removed by a force push. How many were left out is reported. This rule is provisional.
- Unknown line counts are never treated as zero. A sum over only some commits is marked (
Line counts are easily dominated by generated files, formatting and dependency updates. They describe what changed, not how much or how well anyone worked. See Lines changed.
Cache: the cache schema moves to version 3. A cache opened by 0.1.5 cannot be read by older versions. Pull requests synced before this version have no recorded merge method, so their commits are left out of line totals until you run ghusage sync --full for the period.
Performance
Incremental syncs are about 2.4 times faster. Measured with the published 0.1.4 and 0.1.5 on the same account (sync --since 30d, Apple M4, versions alternating with 90 s pauses):
| 0.1.4 | 0.1.5 | |
|---|---|---|
| Incremental sync (mean of runs) | 14.8 s | 6.2 s |
| Requests per incremental sync | 45–47 | 46–47 |
The number of requests is unchanged; the time saved comes from running them at the same time:
- Search pages and REST pages beyond the first are fetched in parallel, since the first page tells how many there are.
- Commit search and the repository list start together with the pull request search.
- A search page that GitHub reports as incomplete (its search timed out) is fetched again before the range is reported as partial.
A first sync of an empty cache is not faster: it is bound by GitHub's search rate limit (30 requests per minute). Cached reports are as fast as in 0.1.4 (cached 7-day aggregation p95 85 ms, 30-day 118 ms on Apple M4 with 100,000 events).
Sync progress
While a sync runs in a terminal, the progress now shows how many requests run in parallel out of --concurrency, how many have finished, and up to four of the requests in flight with how long each has been running.
Other changes
- Documentation site: sitemap,
robots.txt, canonical URLs, Open Graph tags, and links between the English and Japanese pages. - Issue forms and a pull request template.
- The documentation now gives the correct default for
--concurrency(8).
Install / update
npm install -g ghusage@0.1.5Full changelog: v0.1.4...v0.1.5
ghusage 0.1.4
Markdown output and profile READMEs
- New output format:
--format markdownrendersoverview,daily,weekly,monthly,yearlyandreposas GitHub-flavored Markdown tables.- Text from GitHub is sanitized, and any Markdown or HTML syntax in it is escaped, so it cannot break the tables or add links and images.
- Like JSON and CSV, private repository names are hidden unless
--include-privateis given. - Other commands reject the format with exit code 2.
- New guide: Profile README (日本語). It has a ready-to-copy GitHub Actions workflow that updates a section of your profile README every day. The section sits between
<!-- ghusage:start -->and<!-- ghusage:end -->markers. The workflow keeps the ghusage cache between runs, so each run only syncs what changed. It uses--public-onlyand--require-complete, so a run with incomplete data leaves the README unchanged.
ghusage overview --since 30d --public-only --format markdownFixes
- Terminal UI: on narrow terminals, the Repositories tab now hides its less important columns, so repository names stay readable. It drops PR events, active PRs, issues, merged, reviews and then visibility, in that order. Before, a 110-column terminal left about eight characters for the name.
- Terminal UI: on macOS and Linux,
SIGTERMandSIGHUPnow end the UI the same wayqdoes, so the terminal is restored. Before, the terminal was left in the alternate screen with input echo off.
Documentation
- The home page of the documentation site now shows a terminal screenshot.
- Known limitations are updated for the two fixes above.
Install / update
npm install -g ghusage@0.1.4Full changelog: v0.1.3...v0.1.4
ghusage 0.1.3
Faster reports from the cache
Reports over a period (overview, daily, prs, the terminal UI, ...) load much faster from a large cache. The output is unchanged.
- Earlier history only where it is used. For lifetime timings such as time to first review, a period load also reads events from before the period. It did this for every pull request active in the period. Timings are computed only for your own pull requests, so the earlier history is now read only for those.
- Cheaper row decoding. Reading a cached event looked up each of its columns by name on every row, and profiles showed this lookup dominating large loads. Column positions are now resolved once per query.
Benchmark with 100,000 cached events (release build, p95):
| 0.1.2 | 0.1.3 | Target | |
|---|---|---|---|
| Cached 7-day aggregation (load + overview), CI runner (x64) | 643 ms | 145 ms | ≤ 200 ms |
| Cached 30-day aggregation (load + overview), CI runner (x64) | 806 ms | 223 ms | ≤ 500 ms |
| Cached 7-day aggregation, Apple Silicon | — | 94 ms | ≤ 200 ms |
| Cached 30-day aggregation, Apple Silicon | — | 126 ms | ≤ 500 ms |
The CI rows compare both versions on the same runner. The Apple Silicon rows were measured locally (50 runs after 5 warm-up runs).
Documentation
- Known limitations: waiting for an exhausted primary rate limit has been checked against the real GitHub API by using up the search limit. Secondary rate limits are still covered only by tests that simulate GitHub's responses.
Install / update
npm install -g ghusage@0.1.3Full changelog: v0.1.2...v0.1.3
ghusage 0.1.2
Highlights
Open a commit and read its diff
- New command:
ghusage commit <OWNER/REPO@SHA | commit URL> [--patch]shows one commit: its author and committer, parents, full message and changed files with lines added and removed. Add--patchto print the diff. It also accepts.../pull/NUMBER/commits/SHAURLs and--format json. - In the terminal UI, the PR Detail screen now lists the pull request's commits, oldest first. Commits removed by a force push stay in the list, dimmed and marked
removed. PressTabto move the focus to the list,/to search it,Enterto open a commit andoto open it on GitHub. - The new Commit screen shows the commit's details, the changed files and a colored diff. The diff keeps its
+,-and@@prefixes, so it is readable without color. Use]and[to jump between files. The commit loads in the background, so the UI keeps responding while it loads. - Fetched commits are cached, so a commit you have opened once can be shown again with
--offline. The cache includes the commit message, file names and the diff. See Privacy.
npm installs recover from a missing native package
ghusage on npm ships its binary in a per-platform optional dependency (@ghusage/ghusage-<os>-<arch>). Sometimes the optional dependency doesn't get installed. This happens, for example, when a registry mirror or a supply-chain proxy has not picked up the new version yet. Before, the command then failed with "Missing optional native package".
- The launcher now fetches the missing native package on first run. It uses your own npm configuration (registry, proxy and auth), so the package comes from wherever
npmitself would fetch it, and it is stored in a cache directory. - Set
GHUSAGE_NO_AUTO_INSTALL=1to turn this off. SetGHUSAGE_CACHE_DIRto choose where the package is stored. - The release process now waits until every platform package is available on the registry before it publishes the main package.
- See Getting started → Missing native package for updating and for fixing an install by hand.
Japanese documentation
The documentation site has moved to https://ghusage.under18.dev and now has a full Japanese translation at /ja/.
Fixes
- Reports over a period loaded slowly from a large cache. For each pull request active in the period, SQLite scanned all of the account's cached events. The query now uses the pull request index. In the debug benchmark, cached 7- and 30-day loads went from over two minutes to seconds.
- TUI: the PR timing row "Review → author reply" is renamed "Review → next author activity". The value counts any next activity by the author, not only replies.
Documentation
- Known limitations now cover:
- narrow terminals
- termination by signal (the terminal UI does not restore the terminal after
SIGTERM) - the permissions of an existing data directory, which are left unchanged
- The Platforms section now says what has been checked by hand on Windows and states that Linux is covered by CI only.
- The rate-limit section now states that rate-limit handling is tested with simulated GitHub responses, not by exhausting a real account's limits.
Install / update
npm install -g ghusage@0.1.2Full changelog: v0.1.1...v0.1.2