GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [4/6] Report the per-ecosystem breakdown from GET /stats by wickedOne · Pull Request #391 · git-pkgs/proxy

Conversation

@wickedOne

@wickedOne wickedOne commented Oct 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

GET /stats reports the per-ecosystem breakdown

Part 4 of six splitting #381 ("analytics dashboard") into reviewable pieces, as the review there asked for. #381 stays open as the umbrella and reference thread until the last of these lands; it is not meant to be merged.

Series: #388 route coverage · #389 ecosystem stats · #390 analytics page · #391 /stats breakdown · #392 Grafana dashboard · #393 source attribution

Needs #389 and #390, and branches off #390, so until those merge the Files changed tab here shows all three. The last commit is this part.

/stats answered from two cheap counters. It now also carries downloaded_bytes, downloads and an ecosystems array, served from the same 60-second snapshot the gauges and the analytics page read, so a polling client does not re-run the aggregation per request.

stats_unavailable

Raised in the review of #381: when the aggregation fails with no retained snapshot, zeros and an empty array are indistinguishable from an idle proxy for anything consuming the JSON. The response now carries stats_unavailable: true in that case.

It is a new field with omitempty rather than pointer totals, so the field set stays stable for existing consumers and a healthy response is byte-identical to one without the flag. A retained snapshot is served on without the flag -- those figures are stale, not absent, and staleness is surfaced to a human on the page rather than to a machine here.

The comment above the call in #381 claimed the breakdown is omitted when there is no snapshot. That held for the array but not for the totals; it now says what the code does.

The endpoint keeps answering with the artifact count and cache size either way: a failing breakdown does not take down an endpoint that worked before it existed.

Tests cover all three states. There were none for the /stats shape before.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
This was referenced Oct 1, 2026
[1/6] Name every mounted route in requestEcosystem #388
Merged
[2/6] Per-ecosystem cache and download statistics #389
Merged
[3/6] Add the /ui/analytics page #390
Merged
@wickedOne wickedOne changed the title Analytics 4 stats breakdown Report the per-ecosystem breakdown from GET /stats Oct 1, 2026
This was referenced Oct 1, 2026
[5/6] Add a Grafana dashboard #392
Merged
[6/6] Attribute requests to a caller and a client tool #393
Merged
@wickedOne wickedOne changed the title Report the per-ecosystem breakdown from GET /stats [4/6] Report the per-ecosystem breakdown from GET /stats Oct 1, 2026
wickedOne and others added 3 commits October 1, 2026 16:15
@wickedOne @claude
Per-ecosystem cache and download statistics
4ebd805
- Add GetEcosystemStats, aggregating packages, versions, artifacts,
  cache size, downloads and downloaded bytes per ecosystem
- Publish six proxy_ecosystem_* gauges from it on the existing
  one-minute cache-stats tick
- Set and selectively delete rather than Reset, so no scrape lands on
  a half-populated vector
- Report artifacts with no package row under "unattributed" rather
  than dropping them, so the figures still add up

Part 2 of 6 splitting git-pkgs#381 up.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@wickedOne @claude
Add the /ui/analytics page
0501534
- Ring of download size by ecosystem, cache figures, per-ecosystem
  table, vulnerability overview and a Runtime card
- Add metrics.Gather so the page can render counters that were never
  in the database
- Add proxy_response_bytes_total and response-writer byte counting
- Serve a retained snapshot behind a staleness banner when the
  aggregation fails, rather than rendering old figures as current
- Extract the security overview into a shared component

Part 3 of 6 splitting git-pkgs#381 up.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@wickedOne @claude
Report the per-ecosystem breakdown from GET /stats
4b8c5a8
- Add downloaded_bytes, downloads and an ecosystems array, served from
  the snapshot the gauges and the page already share
- Add stats_unavailable so a failed aggregation is distinguishable
  from an idle proxy
- Regenerate the OpenAPI spec

Part 4 of 6 splitting git-pkgs#381 up.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@wickedOne
wickedOne force-pushed the analytics-4-stats-breakdown branch from f169c81 to 4b8c5a8 Compare October 1, 2026 14:19
@andrew
andrew merged commit 7c129f9 into git-pkgs:main Oct 2, 2026
6 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@wickedOne
wickedOne deleted the analytics-4-stats-breakdown branch October 2, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@wickedOne @andrew
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.