@@ -180,7 +180,7 @@ export default class Provisioner extends ProvisionerConfigurableBase {
180
180
let isBelowMin = this . isBelowMin ( adjustmentContext ) ;
181
181
let isAboveThreshold = this . isAboveThreshold ( adjustmentContext ) ;
182
182
let isBelowThreshold = this . isBelowThreshold ( adjustmentContext ) ;
183
- let isAdjustmentWanted = ( isAboveMax || isAboveMax || isAboveThreshold || isBelowThreshold ) ;
183
+ let isAdjustmentWanted = ( isAboveMax || isBelowMin || isAboveThreshold || isBelowThreshold ) ;
184
184
185
185
// Determine if an adjustment is allowed under the rate limiting rules
186
186
let isAfterLastDecreaseGracePeriod = this . isAfterLastAdjustmentGracePeriod (
@@ -221,6 +221,12 @@ export default class Provisioner extends ProvisionerConfigurableBase {
221
221
return false ;
222
222
}
223
223
224
+ if ( context . CapacityConfig . Max != null &&
225
+ context . ProvisionedValue >= context . CapacityConfig . Max ) {
226
+ // Already at maximum allowed ProvisionedValue
227
+ return false ;
228
+ }
229
+
224
230
let utilisationPercent = ( context . ConsumedValue / context . ProvisionedValue ) * 100 ;
225
231
return utilisationPercent > context . CapacityAdjustmentConfig . When . UtilisationIsAbovePercent ;
226
232
}
@@ -232,6 +238,12 @@ export default class Provisioner extends ProvisionerConfigurableBase {
232
238
return false ;
233
239
}
234
240
241
+ let min = context . CapacityConfig . Min != null ? context . CapacityConfig . Min : 1 ;
242
+ if ( context . ProvisionedValue <= min ) {
243
+ // Already at minimum allowed ProvisionedValue
244
+ return false ;
245
+ }
246
+
235
247
let utilisationPercent = ( context . ConsumedValue / context . ProvisionedValue ) * 100 ;
236
248
return utilisationPercent < context . CapacityAdjustmentConfig . When . UtilisationIsBelowPercent ;
237
249
}
@@ -243,7 +255,7 @@ export default class Provisioner extends ProvisionerConfigurableBase {
243
255
return false ;
244
256
}
245
257
246
- return context . ConsumedValue > context . CapacityConfig . Max ;
258
+ return context . ProvisionedValue > context . CapacityConfig . Max ;
247
259
}
248
260
249
261
isBelowMin ( context : AdjustmentContext ) : boolean {
@@ -253,7 +265,7 @@ export default class Provisioner extends ProvisionerConfigurableBase {
253
265
return false ;
254
266
}
255
267
256
- return context . ConsumedValue < context . CapacityConfig . Min ;
268
+ return context . ProvisionedValue < context . CapacityConfig . Min ;
257
269
}
258
270
259
271
isAfterLastAdjustmentGracePeriod ( lastAdjustmentDateTime : string , afterLastAdjustmentMinutes ?: number ) : boolean {
0 commit comments