After redesigning one of the pages in SAP BTP Cockpit, we would like to include a key metric - the available memory of a space.
Currently, the endpoint /v3/spaces/:guid/usage_summary provides information about used memory, but to calculate the available memory we need additional logic on the client side:
- Detect whether the space uses a space quota or defaults to the org quota.
- Apply different calculations based on this.
- Perform extra API calls to retrieve quota details.
Since the page already aggregates multiple metrics, every additional call affects the performance.
Our proposal is to enhance the response of /v3/spaces/:guid/usage_summary to include a new field available_memory_in_mb, which should represent the remaining memory capacity available for allocations within the space, respecting both space and org quotas:
- If the space has a space quota assigned:
available_memory = space_quota_memory_limit - used_memory
- If the space has no space quota:
available_memory = org_quota_memory_limit - used_memory
- If the space quota is greater than the org’s remaining available memory, the available memory must be capped by the org:
available_memory = min(space_quota_memory_limit, org_available_memory) - used_memory
After redesigning one of the pages in SAP BTP Cockpit, we would like to include a key metric - the available memory of a space.
Currently, the endpoint
/v3/spaces/:guid/usage_summaryprovides information about used memory, but to calculate the available memory we need additional logic on the client side:Since the page already aggregates multiple metrics, every additional call affects the performance.
Our proposal is to enhance the response of
/v3/spaces/:guid/usage_summaryto include a new fieldavailable_memory_in_mb, which should represent the remaining memory capacity available for allocations within the space, respecting both space and org quotas:available_memory = space_quota_memory_limit - used_memoryavailable_memory = org_quota_memory_limit - used_memoryavailable_memory = min(space_quota_memory_limit, org_available_memory) - used_memory