UC-ADM-102: Real-Time Performance Monitoring
1. Metadata
| Property | Value |
|---|---|
| ID | UC-ADM-102 |
| Actor | District Administrator |
| Trigger | Access of the 'Live Monitoring' dashboard |
| Pre-conditions | Schools have submitted daily logs; Aggregation pipeline is functional |
| Post-conditions | Real-time charts updated; Heatmap reflects latest screenings |
| Side Effects | Notify Field Coordinators of schools with low participation (<30%) |
2. Description
Provides administrators with a high-level topographical view of program performance, allowing for immediate tactical interventions.
3. Success Scenario
- Dashboard Entry: Admin navigates to the "Live Impact" tab in the Web Console.
- Parameter Selection: Admin filters by Region (District) and Timeframe (Past 24 Hours).
- Real-Time Fetch: System queries the PostgreSQL
materialized_viewsfor the latest aggregated metrics. - Visualization:
- System displays a Heatmap showing schools by screening completion %.
- System renders a Bar Chart for "Top Nutritional Gaps" identified today.
- Drill-Down: Admin clicks on a 'Red' school node to view specific class-level attendance.
- Communication: Admin selects "Alert Coordinator" to send an automated intervention nudge.
4. Acceptance Criteria
- [ ] Latency: Dashboard widgets must load in < 1500ms for district-wide datasets.
- [ ] Accuracy: Aggregated data must be consistent with raw ingestion logs within a 60-second window.
- [ ] Interactivity: Charts must allow tooltips and deep-linking to specific school profiles.
5. Aggregation Logic (Real-Time Metrics)
flowchart TD
DB[(PostgreSQL Logs)] --> Filter[Date = CURRENT_DATE]
Filter --> Group[Group by School]
Group --> Calc[Calculated Screened Count & Avg BMI]
Calc --> Threshold{Count < Target?}
Threshold -- Yes --> Alert[Flag for Coordinator]
Threshold -- No --> Dashboard[Render to Widget]