code: function getAggregatedCosts(data, metrics) {
      var sum = 0;
      var unit = 'USD';
  
      Object.keys(data.ResultsByTime).forEach(function(key) {
          if (metrics == "BlendedCost") 
              sum = sum + parseInt(data.ResultsByTime[key].Total.BlendedCost.Amount);
          else 
              sum = sum + parseInt(data.ResultsByTime[key].Total.UnblendedCost.Amount);
  
          unit = data.ResultsByTime[key].Total.BlendedCost.Unit;
        });
      
      data.Total = {
          "Amount" : sum,
          "Unit" : unit
      };
  
      return data;
  
  }
docs: private