Skip to content

Conversation

murparreira
Copy link
Contributor

Context

The current_usage endpoint is frequently called across the application. Adding the projected usage calculation was causing significant memory spikes due to the high request volume, impacting application performance.

By moving the expensive calculation to a dedicated endpoint, we ensure that fetching basic usage remains fast and stable, while still providing the projection data when it's explicitly needed. This resolves the memory issues and improves overall stability.

Description

Creates a new endpoint, GET /customers/:external_customer_id/projected_usage, to handle the computationally intensive projected usage calculation.

Reverts the existing /customers/:external_customer_id/current_usage endpoint to its original, lightweight state by removing the projection logic.

@murparreira murparreira merged commit 2d683f8 into main Aug 11, 2025
14 checks passed
@murparreira murparreira deleted the feat/new-endpoint-for-projected-usage branch August 11, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants