Skip to content

feat(analytics): add time-series aggregation pipeline with hourly and daily rollups#859

Merged
temma02 merged 1 commit into
StellerCraft:mainfrom
Nexha-dev:feat/analytics-timeseries-aggregation-pipeline
Jun 27, 2026
Merged

feat(analytics): add time-series aggregation pipeline with hourly and daily rollups#859
temma02 merged 1 commit into
StellerCraft:mainfrom
Nexha-dev:feat/analytics-timeseries-aggregation-pipeline

Conversation

@Nexha-dev

Copy link
Copy Markdown
Contributor

Closes #768

Summary

Adds an incremental time-series aggregation pipeline that pre-computes hourly (1h) and daily (24h) rollups of deployment analytics, enabling fast dashboard queries without full table scans.

Changes

  • Migration 016_analytics_rollups.sqlanalytics_rollups table (unique on deployment_id, metric_type, granularity, bucket_start) plus a rollup_cursors table tracking last-aggregated time per granularity, with RLS policies.
  • analytics-aggregation.service.ts — incremental rollup: reads the cursor, fetches only new deployment_analytics rows since the cursor, groups them into time buckets, upserts (idempotent recompute), and advances the cursor.
  • /api/cron/aggregate-analytics/route.ts — cron-authenticated endpoint that runs both 1h and 24h aggregations (intended to run hourly).
  • Tests for incremental aggregation, hourly/daily bucket assignment, up_count for uptime checks, empty-cursor no-op, and idempotency.

Notes

  • Rollup granularities: 1h and 24h. Incremental — only new events since the last run are aggregated.

🤖 Generated with Claude Code

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Nexha-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@temma02 temma02 merged commit e884ce3 into StellerCraft:main Jun 27, 2026
0 of 7 checks passed
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.

Build Analytics Data Pipeline with Time-Series Aggregation for Deployment Metrics

2 participants