public AutoThrottleBatchSize ( int amountOfItemsToIndex, long size, System.TimeSpan indexingDuration ) : void | ||
amountOfItemsToIndex | int | |
size | long | |
indexingDuration | System.TimeSpan | |
return | void |
public void AutoThrottleBatchSize(int amountOfItemsToIndex, long size, TimeSpan indexingDuration)
{
try
{
if (ReduceBatchSizeIfCloseToMemoryCeiling())
return;
if (ConsiderDecreasingBatchSize(amountOfItemsToIndex, indexingDuration))
return;
if (ConsiderIncreasingBatchSize(amountOfItemsToIndex, size, indexingDuration))
lastIncrease = SystemTime.UtcNow;
}
finally
{
RecordAmountOfItems(amountOfItemsToIndex);
}
}