Skip to content

stats: show downloads chart per-week instead of per-day#58

Merged
ErikBjare merged 1 commit into
masterfrom
fix/downloads-chart-per-week
Jul 11, 2026
Merged

stats: show downloads chart per-week instead of per-day#58
ErikBjare merged 1 commit into
masterfrom
fix/downloads-chart-per-week

Conversation

@ErikBjare

Copy link
Copy Markdown
Member

The downloads chart (img/stats/downloads.png) bottom subplot reads better as a weekly rate (~9k/week) than a daily one (~1.3k/day), matching what it showed before the recent ActivityWatch/stats refactor.

Both --per-day and --per-week now render a 7d-rolling-smoothed line (after the stats-repo smoothing fix), so this is purely a display/magnitude choice. One-line Makefile change.

The bottom subplot of downloads.png reads better as a weekly rate. Since
the ActivityWatch/stats analyze_stats.py smoothing fix, --per-day and
--per-week both render a 7d-rolling-smoothed line; --per-week restores the
weekly magnitude the chart showed before the recent stats refactor.
@ErikBjare
ErikBjare merged commit 796ce99 into master Jul 11, 2026
2 checks passed
@ErikBjare
ErikBjare deleted the fix/downloads-chart-per-week branch July 11, 2026 23:14
@greptile-apps

greptile-apps Bot commented Jul 11, 2026

Copy link
Copy Markdown

Greptile Summary

This PR changes how the downloads stats chart is generated.

  • Switches the downloads chart from a daily rate to a weekly rate.
  • Keeps the generated image path unchanged at img/stats/downloads.png.
  • Leaves the other stats chart commands unchanged.

Confidence Score: 4/5

The changed stats build path is mergeable after tightening the external CLI dependency.

  • The only changed command now relies on --per-week in an unpinned external checkout.
  • If that checkout lacks the flag, the stats image generation command can fail during the site build.
  • No security issue was found.

Makefile

Important Files Changed

Filename Overview
Makefile Updates the downloads chart command to use --per-week; the external stats CLI version remains unpinned.

Reviews (1): Last reviewed commit: "stats: show downloads chart per-week ins..." | Re-trigger Greptile

Comment thread Makefile
mkdir -p img/stats
mkdir -p stats/out
cd stats && poetry run python analyze_stats.py --since 2017-07-01 --column downloads --per-day --save ../img/stats/downloads.png
cd stats && poetry run python analyze_stats.py --since 2017-07-01 --column downloads --per-week --save ../img/stats/downloads.png

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unpinned Stats CLI Contract

This command now depends on --per-week being supported by the freshly cloned ActivityWatch/stats checkout, but the stats target clones the external repo at its current default branch without a pinned revision. A build that lands on a checkout without this flag exits from analyze_stats.py argument parsing and stops the site build instead of generating img/stats/downloads.png.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant