Add precompute tables for uploads and pending posts#3
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a comprehensive tiling and lifecycle tracking system for upload and post data. The changes add precomputed aggregation tables that improve query performance for time-series metrics and implement a job queue system with support for multiple independent queues.
Key changes include:
- Implementation of hourly tile aggregation for upload counts with background workers for data generation
- Creation of a post lifecycle table that tracks upload, approval, deletion, and permit timestamps in a single denormalized structure
- Enhancement of the job service to support multiple named queues that process jobs independently
- Addition of health monitoring endpoints for tracking tile coverage and data availability
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
src/upload/tiles/* |
New upload tiles module with entity, service, worker, and module for aggregating upload counts by hour |
src/post/lifecycle/* |
New post lifecycle module that denormalizes post state changes into a single table for efficient querying |
src/post/metric/post-metric.service.ts |
Refactored to use lifecycle table with raw SQL queries for pending post calculations |
src/upload/metric/upload-metric.service.ts |
Split count methods to use tiles for general counts and direct queries for per-uploader metrics |
src/job/job.* |
Enhanced job service to support multiple independent queues instead of single global queue |
src/common/tile.ts |
New shared utilities for tile generation, range calculation, and missing tile detection |
src/health/tiles/* |
New tile health monitoring system with endpoints to check tile coverage and delete stale data |
src/migration/* |
Database migrations for new tables (upload_hourly_tiles, post_lifecycle) and manifest updates |
src/common/date/date-buckets.ts |
Added helper functions for generating series points from tile data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.