Request Throttling Based on CPU Load
Request Throttling Based on CPU Load: a task in LegoFlow-SWE (Harbor dataset). calculateRequests formula: allowed = (100 - currentLoad) / (100 - threshold) maxRequests Edge cases: - If currentLoad = 100 , return maxRequests . - If currentLoad < threshold , return maxRequests . - Integer division…
The task
**`calculateRequests` formula:** ``` allowed = (100 - currentLoad) / (100 - threshold) * maxRequests ``` **Edge cases:** - If `currentLoad >= 100`, return `maxRequests`. - If `currentLoad < threshold`, return `maxRequests`. - Integer division is acceptable; the result is an integer.
Part of Lego-X/LegoFlow-SWE.