Closed davidor closed 3 years ago
@unleashed I added a new commit with the tests that were missing. It's the last commit.
I also added a Memoizer.clear
call here: https://github.com/3scale/apisonator/pull/287/files#diff-b176f67b39cc7bd8b50fe54aa2a4de9cf404809e691aab4a2199d6aa8dc10011R84
bors delegate+
:v: davidor can now approve this pull request. To approve and merge a pull request, simply reply with bors r+
. More detailed instructions are available here.
bors r+
Build succeeded:
Currently, the code is loading all the usage limits of a plan and the current usages for those limits on every report job.
This PR introduces a new class (
UsageChecked
) that allows us to do just once and then, no longer do it for the same application until: 1) An alert expires (24h passed since it was triggered) and can be raised again. 2) A new alert bin is enabled for the service.With this, on every report job we just need to check the limits and usages of the metrics increased in the job. This should have a noticeable impact for users with many usage limits defined.