Add active resource overview API for domains and projects
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
Add API endpoints (GraphQL + REST) to query real-time aggregated resource allocation for active sessions, scoped by domain or project.
Currently DomainV2GQL / ProjectV2GQL only expose fair_share (scheduling priority) and usage_buckets (historical usage). There is no API to query the current total occupied resources across active sessions within a domain or project.
The scheduler internally aggregates this via ResourceOccupancySnapshot, but it is scoped to scaling_group and not exposed externally.
With the resource_allocations normalization (BEP-1047, BA-4308), efficient SQL-level SUM + GROUP BY aggregation is now possible.
This Epic covers:
- Repository/Service layer for SQL aggregation
- GraphQL resolver fields on DomainV2 / ProjectV2
- REST API endpoints
- Usage ratio calculation against total_resource_slots
JIRA Issue: BA-4914
Contributor guide
Assessment
This issue has not been assessed yet.