internal AutoscaleDirection ComputeScaleDirection(
            bool isCircuitBreakerTripped,
            long provisioned,
            DynamoDbThroughputMetrics metrics,
            AutoscalingConfiguration configuration)
        {
            var upperThreshold = configuration.UpperThreshold.GetValueOrDefault();
            var lowerThreshold = configuration.LowerThreshold.GetValueOrDefault();
            var throttleThreshold = configuration.ThrottleThreshold.GetValueOrDefault();

            return ComputeScaleDirection(
                isCircuitBreakerTripped, provisioned, metrics.ConsumedCapacityUnits, upperThreshold, lowerThreshold, throttleThreshold,
                metrics.ThrottleEvents, metrics.ConsumptionDirection, metrics.ThrottleDirection);
        }
        internal long ComputeUpdatedProvisioned(
            long provisioned,
            AutoscaleDirection autoscaleDirection,
            DynamoDbThroughputMetrics metrics,
            AutoscalingConfiguration configuration)
        {
            var increasePercent = configuration.IncreaseWithPercent.GetValueOrDefault();
            var decreasePercent = configuration.DecreaseWithPercent.GetValueOrDefault();
            var minProvisioned = configuration.MinProvisioned.GetValueOrDefault();
            var maxProvisioned = configuration.MaxProvisioned.GetValueOrDefault();

            return ComputeUpdatedProvisioned(
                autoscaleDirection, provisioned, increasePercent, decreasePercent, minProvisioned, maxProvisioned);
        }
 internal long EnsureProvision(
     bool isCircuitBreakerTripped,
     long provisioned, 
     DynamoDbThroughputMetrics metrics,
     AutoscalingConfiguration configuration)
 {
     var scaleDirection = ComputeScaleDirection(isCircuitBreakerTripped, provisioned, metrics, configuration);
     var updated = ComputeUpdatedProvisioned(provisioned, scaleDirection, metrics, configuration);
     return updated;
 }