Skip to content

Analytics Dashboard - Phase 2: Backend Query API #5

@Michael-CNS

Description

@Michael-CNS

Analytics Dashboard - Phase 2: Backend Query API

Part of epic: #3
Depends on: #4

Objective

Build the complete set of API endpoints in the analytics service to retrieve and aggregate simulation data from ArangoDB.

Tasks

Endpoints to implement:

  • GET /snapshots - List all available simulation runs with metadata
  • GET /snapshots/{run_id} - Get detailed info for a specific run
  • GET /snapshots/{run_id}/statistics - Aggregate statistics (mean/median/min/max RSRP, coverage %, etc.)
  • GET /snapshots/{run_id}/distribution - RSRP distribution data for histogram (bins and counts)
  • GET /snapshots/{run_id}/reports - Paginated UE reports with filters (query params: page, limit, min_rsrp, max_rsrp, cell)
  • GET /snapshots/{run_id}/reports/{user_id} - Individual UE full report (all cells visible)
  • GET /snapshots/{run_id}/cell-load - Cell load distribution (UEs per cell)
  • GET /compare?run_id_1=X&run_id_2=Y - Compare two runs (statistics delta)

Query Logic:

  • Write efficient AQL queries for each endpoint
  • Implement server-side aggregation (don't load all UEs into memory)
  • Add pagination helpers for large result sets
  • Implement filtering logic (RSRP range, location bounds, etc.)
  • Add response models/schemas for type safety

Acceptance Criteria

  • All endpoints return correct data
  • Queries execute in <2 seconds for 30k UE scenarios
  • Pagination works correctly
  • Filtering parameters work as expected
  • Proper error handling for invalid run_ids or parameters
  • API documentation (OpenAPI/Swagger) available

Technical Notes

  • Use AQL for aggregations (don't pull all data to Python)
  • Consider indexes on run_id, best_rsrp if queries are slow
  • Return lightweight responses (don't include full cell configs in every response)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions