Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Forecasting

Sergio Ocón edited this page May 22, 2018 · 1 revision

As the engine, I want to be able to calculate the costs associated to one account at one specific time in the future.

In order to calculate the costs in a defined time in the future, it is necessary to calculate some input data:

  • Inventory and inventory variations during the period to be forecasted. Is the inventory evolving? Are elements being created and destroyed? What is the inventory at each moment in time? Can elements in the inventory change (i.e. different set of CPU for different points in time)
  • Metrics. For each inventory item, there is a need to understand what are the metrics that will be used to calculate the cost. Metrics can vary depending on the rate, based on reserved or actual data. Metrics need to be calculated for the period of the forecast.
  • Rate applied. Price plans can be different for each user, it is necessary to understand the specific rates to be applied to each element of the inventory.

For example, a user is forecasting the cost of a service, consisting on 4 VM running on AWS for the full month. The account used in Amazon has negotiated a 15% discount, and the volume due to other services does not exceed the basic levels, so there is no modification of the rates due to accrued traffic. The engine will need to:

  1. Calculate the overall traffic for the account (because some costs, like network, depend on the project, not on the VM itself).
  2. Follow up on the inventory (does the inventory changes over time? Are all VM running all the time or at the same time? What flavour is being used? Is a spot or on-demand?)
  3. Find the rate for all elements (part of a price plan). As the rate can depend on the user owning the assets, it is necessary to find the rate
  4. Apply the rate to all elements in the service, using all the data in points 1-3.
  5. Calculate any discounts

For this repo, only elements 4 and 5 will be taken into account. The rest must be provided as an input.