private double CalculateForecastedThroughput(TrendModel trend) { return(trend.Slope * (trend.LastRecordIndex + 5) + trend.Intercept); }
private async Task ScaleUnstableTrendAsync(string databaseId, string collectionId, TrendModel trend) { if (_slopeThreshold <= trend.Slope) { double forecastedThroughput = CalculateForecastedThroughput(trend); await Scaler.AdjustThroughputAsync(new ScaleRequest(databaseId, collectionId, (int)forecastedThroughput)); } }