Skip to content

Comments

Add script to aggregate metrics#68

Merged
amrit110 merged 1 commit intomainfrom
add_aggregate_script
Feb 18, 2026
Merged

Add script to aggregate metrics#68
amrit110 merged 1 commit intomainfrom
add_aggregate_script

Conversation

@amrit110
Copy link
Member

This pull request refactors the analytics snapshot API to serve pre-computed aggregates instead of calculating metrics on each request. The main changes include updating the API route and GCS utility functions to fetch a new analytics_aggregate.json file, removing server-side metric computation, and cleaning up unused types. This will improve performance and simplify the analytics service.

API and Data Flow Refactor:

  • The /api/snapshot route (route.ts) now returns the pre-computed analytics aggregate from GCS, removing all on-the-fly metric calculations and enrichment.
  • The GCS utility (gcs.ts) replaces getLatestSnapshot with getAnalyticsAggregate, fetching the new analytics_aggregate.json file. All snapshot history and bucket-checking functions are removed as they're no longer needed.

Workflow and Data Generation:

  • The GitHub Actions workflow (collect-coder-analytics.yml) adds a step to run the analytics aggregation script after data collection, ensuring the aggregate is always up to date.

Codebase Cleanup:

  • Unused types and interfaces related to the old snapshot structure are removed from types.ts, reflecting the switch to the new aggregate format.
  • Imports and type references are updated throughout to use the new AnalyticsSnapshot type.

@amrit110 amrit110 self-assigned this Feb 17, 2026
@amrit110 amrit110 added enhancement New feature or request refactor Refactor the structure of code labels Feb 17, 2026
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.84%. Comparing base (ee98df0) to head (1131db3).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #68   +/-   ##
=======================================
  Coverage   89.84%   89.84%           
=======================================
  Files          10       10           
  Lines        1438     1438           
=======================================
  Hits         1292     1292           
  Misses        146      146           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amrit110 amrit110 merged commit 9b629bd into main Feb 18, 2026
9 checks passed
@amrit110 amrit110 deleted the add_aggregate_script branch February 18, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor Refactor the structure of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant