Boavizta / cloud-scanner

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

Add a parameter to pass the duration of use when exposing metrics and data in standalone server mode #332

Open demeringo opened 1 year ago

demeringo commented 1 year ago

Problem

In the standalone server mode metrics returned are always calculated for an arbiratry duration of one hour.

This means that cloud scanner returns the impacts equivalent of one hour of use for stae of the inventory at a given point in time.

See https://github.com/Boavizta/cloud-scanner/discussions/328

Solution

The metric URL and the URL that returns impacts should accept an optional hour_use_duration parameter (like in CLI mode).

The default value for this parameter should remain one hour.

We should update the doc accordingly.

Alternatives

Additional context or elements

In CLI mode, cloud scanners already accepts a hours_use_time parameter that defines the duration of use that we want to consider in the calculation.

demeringo commented 1 year ago

We should also check that this is consistant in the aws lambda implementation.

demeringo commented 1 year ago

@damienfernandes