fleet-stats
real-time fleet analytics across two databases, fused
- 2 datastores, 1 service
- 17 parallel SQL queries
- 31 visualizations
An operations dashboard that fuses two unrelated datastores into one Fastify service: a document store of human-review events and a relational store of a distributed crawler's job, grid, and output state. Its metrics are computed live on every request.
No single database owns both sides of the relationship. So cross-cutting metrics such as review coverage, unreviewed backlog, and per-query review bias are derived by reconciling identifiers across the two stores in the application layer.
Each endpoint fans out its workload concurrently: seventeen parallel SQL queries for crawler and dataset statistics, eight document-store aggregation pipelines for reviewer activity, and a mixed pass that builds a per-worker search-coverage matrix. The results are reshaped into chart-ready payloads. Along the way it derives behavioral worker metrics (tenure, active-day cadence, repeat ratio, average daily hours) and back-fills sparse aggregations into dense 60- and 90-day series and hourly heatmaps.
The frontend ships as a single dependency-free template rendering thirty-one visualizations: twenty-nine Chart.js charts plus two custom CSS-grid hourly heatmaps. It's written in strict, modular TypeScript, with pooled database access and graceful dual-connection lifecycle handling.