openflighthpc / flight-control

0 stars 0 forks source link

Update Azure pricing recording to check dates #5

Closed timalces closed 2 years ago

timalces commented 2 years ago

The Azure pricing API often returns multiple price entries for the same instance type in a region, with different dates. We have been using isPrimaryMeterRegion == true to determine the currently active price, but there are in fact some instance types where there is no price returned where this condition is met (for reasons unknown).

To ensure these are not missed, we should compare dates and store the most recent price for a given instance type & region, rather than rely on isPrimaryMeterRegion.