-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
5143: Fix stock performance issues r=jniles a=jniles This PR addresses two performance issues: 1. We cache the results of the stock out/expired stock components on the depot page to prevent multiple calls to that route from hitting the server simultaneously. 2. We've removed calls to `stock_consumption` in the stock controller and merged the calls to `getCMM` into a single function. Then we optimized the function to only call `getCMM()` for unique depot/inventory pairs. While doing so, I've refactored the CMM calculations in stock/core.js to make the more streamlined and rename generic sounding names to more meaningful names . There are two basic paths through core.js: 1. `getBulkInventoryCMM()` -> `computeInventoryIndicators()` 2. `getBulkInventoryCMM()` -> `computeInventoryIndicators()` -> `computeLotIndicators()` The first path computes S_MAX, S_MIN, and other _inventory_ indicators that relate to the change of stock out. This is good enough for the "Items in Stock" registry and other reports that need to see the data on an inventory level. The second path does everything in the first, but also computes the S_RISK and S_RISK_QUANTITY and other _lot_ indicators at are related to the risk of expiration of an individual lot. Closes #4711 Partially addresses #5127 Partially addresses #5073 Co-authored-by: Jonathan Niles <jonathanwniles@gmail.com>
- Loading branch information
Showing
16 changed files
with
214 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.