Boavizta / cloud-scanner

📡 Get Boavizta impact data for your aws cloud account usage.
GNU Affero General Public License v3.0
32 stars 7 forks source link

Investigate how we can reduce queries to BoaviztaAPI using cache #392

Open demeringo opened 8 months ago

demeringo commented 8 months ago

Problem

We may do a lot of queries against Boavizta API.

Solution

Investigate what could be cached to reduce the load / volume of transfer.

Alternatives

Additional context or elements

The main difficulty to cache queries is that each cloud resource has very specific dynamic values (like CPU usage ) that makes caching queries difficult (they all differs).

One naive approach (but that could work) is to use buckets of values and rounding (i.e. instead of querying API for 12.123% of cpu load, approximate it with a 10% of CPU load). We could pass an optional parameter to cloud-scanner to round the values of the inventory . Having something like 10 steps of CPU load (O%, 10%, 20% .... 100%) would probably be sufficient.