3scale / apisonator

Red Hat 3scale API Management Apisonator backend
https://3scale.net
Apache License 2.0
35 stars 27 forks source link

Perf optimization: Check if alerts can be raised before calculating utilization #275

Closed davidor closed 3 years ago

davidor commented 3 years ago

The update_alerts call in Aggregator can be costly. It loads the usages limits and the current usages to check whether an alert should be raised. This PR introduces a perf optimization. It adds a check to see if there can still be alerts raised for an app (there can only be one every 24h per alert level) before calculating all the usages.

davidor commented 3 years ago

bors r=@unleashed

bors[bot] commented 3 years ago

:clock1: Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

bors[bot] commented 3 years ago

Build succeeded: