aws-samples / aws-samples/sample-edge-to-cloud-digital-ops-workshop
Dashboard volume: mv_fleet_ingest_rate MV + /api/volume route
- Dominant language
- TypeScript
- Stars
- 3
- Forks
- 1
- Avg merge
- 7h 19m
- Merged PRs (30d)
- 12
Description
> **Part of the 4-issue set (Epic → A → B → C → D), one PR.** Spec: [https://github.com/aws-samples/sample-edge-to-cloud-digital-ops-workshop/blob/feat/frac-load-dashboard-timeseries/docs/superpowers/specs/2026-09-09-frac-load-and-dashboard-timeseries-design.md](https://github.com/aws-samples/sample-edge-to-cloud-digital-ops-workshop/blob/feat/frac-load-dashboard-timeseries/docs/superpowers/specs/2026-09-09-frac-load-and-dashboard-timeseries-design.md).
## B — Ingest-rate materialized view + `/api/volume` route
Backend for the dashboard's "incoming data over time" chart. Must reflect **full MSK volume**, so measure it at RisingWave (sees every row).
### Deliverables
1. **`mv_fleet_ingest_rate`** — new RisingWave MV in `risingwave/ddl-cloud.sql` (and keep any helm-applied copy in sync — confirm which of `helm/edge-stack/files/ddl.sql` / `risingwave-ddl-job.yaml` is authoritative for the **cloud** RW): a **5-second `TUMBLE`** window over the fleet source stream, `COUNT(*)` grouped by `deployment_id`, emitting `window_start` (epoch-ms) and `msg_count`. (The existing `mv_fleet_1min_avg` is too coarse — model the new MV on it but at 5s.)
2. **`cloud-dashboard/src/app/api/volume/route.ts`** (new): reads the last ~10 min of `mv_fleet_ingest_rate` windows for `?did=`, returns `[{ window_start, msg_per_s }]` where `msg_per_s = msg_count / 5`. Follow the existing `api/freshness/route.ts` DB-access pattern.
### Acceptance (agent, offline)
- `risingwave/ddl-cloud.sql` contains a `TUMBLE(..., interval '5' second)` `COUNT(*)` MV grouped by `deployment_id` with a `window_start` column.
- `cd cloud-dashboard && pnpm build` (or `pnpm tsc --noEmit`) passes with the new route.
**Blocks C.**
Contributor guide
Research direction
Start by reading the existing mv_fleet_1min_avg in risingwave/ddl-cloud.sql and the DB-access pattern in cloud-dashboard/src/app/api/freshness/route.ts. Confirm whether helm/edge-stack/files/ddl.sql or risingwave-ddl-job.yaml is authoritative for cloud RisingWave, then add the MV and route. Done means the 5-second grouped MV is present, /api/volume returns the specified values, and pnpm build or pnpm tsc --noEmit passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql, typescript
- Domain
- api, backend, databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100