Raven.Database.Prefetching.PrefetchingBehavior.UpdateAutoThrottler C# (CSharp) Méthode

UpdateAutoThrottler() public méthode

public UpdateAutoThrottler ( List jsonDocs, System.TimeSpan indexingDuration ) : void
jsonDocs List
indexingDuration System.TimeSpan
Résultat void
		public void UpdateAutoThrottler(List<JsonDocument> jsonDocs, TimeSpan indexingDuration)
		{
			int currentBatchSize = autoTuner.NumberOfItemsToIndexInSingleBatch;
			int futureLen = futureIndexBatches.Values.Sum(x =>
			{
				if (x.Task.IsCompleted)
				{
					return x.Task.Result.Count;
				}
				return currentBatchSize / 15;
			});

			long futureSize = futureIndexBatches.Values.Sum(x =>
			{
				if (x.Task.IsCompleted)
				{
					var jsonResults = x.Task.Result;
					return jsonResults.Sum(s => (long)s.SerializedSizeOnDisk);
				}
				return currentBatchSize * 256;
			});
			autoTuner.AutoThrottleBatchSize(
				jsonDocs.Count + futureLen, 
				futureSize + jsonDocs.Sum(x => (long)x.SerializedSizeOnDisk),
			    indexingDuration);
		}
	}