Beispiel #1
0
 public void Add(IndexingPerformanceStats other)
 {
     ItemsCount  += other.ItemsCount;
     InputCount  += other.InputCount;
     OutputCount += other.OutputCount;
     foreach (var stats in other.Operations)
     {
         var performanceStats = stats as PerformanceStats;
         if (performanceStats != null)
         {
             var existingStat = Operations.OfType <PerformanceStats>().FirstOrDefault(x => x.Name == performanceStats.Name);
             if (existingStat != null)
             {
                 existingStat.DurationMs += performanceStats.DurationMs;
             }
             else
             {
                 Operations.Add(new PerformanceStats
                 {
                     Name       = performanceStats.Name,
                     DurationMs = performanceStats.DurationMs
                 });
             }
         }
     }
 }
Beispiel #2
0
		protected void AddindexingPerformanceStat(IndexingPerformanceStats stats)
		{
			indexingPerformanceStats.Enqueue(stats);
			while (indexingPerformanceStats.Count > 25)
				indexingPerformanceStats.TryDequeue(out stats);
		}
Beispiel #3
0
		protected void RecordCurrentBatch(string indexingStep, int size)
		{
			var performanceStats = new IndexingPerformanceStats
			{
				InputCount = size, 
				Operation = indexingStep,
				Started = SystemTime.UtcNow,
			};
			currentlyIndexing.AddOrUpdate(indexingStep, performanceStats, (s, stats) => performanceStats);
		}
Beispiel #4
0
 public void Add(IndexingPerformanceStats other)
 {
     ItemsCount += other.ItemsCount;
     InputCount += other.InputCount;
     OutputCount += other.OutputCount;
     foreach (var stats in other.Operations)
     {
         var performanceStats = stats as PerformanceStats;
         if (performanceStats != null)
         {
             var existingStat = Operations.OfType<PerformanceStats>().FirstOrDefault(x => x.Name == performanceStats.Name);
             if (existingStat != null)
             {
                 existingStat.DurationMs += performanceStats.DurationMs;
             }
             else
             {
                 Operations.Add(new PerformanceStats
                 {
                     Name = performanceStats.Name,
                     DurationMs = performanceStats.DurationMs
                 });
             }
         }
     }
 }
Beispiel #5
0
	    protected bool Equals(IndexingPerformanceStats other)
	    {
		    return string.Equals(Operation, other.Operation) && OutputCount == other.OutputCount && InputCount == other.InputCount && Duration.Equals(other.Duration) && Started.Equals(other.Started);
	    }
		public void OnDocumentsIndexed(IEnumerable<Document> documents, Analyzer searchAnalyzer)
		{
			var indexingPerformanceStats = new IndexingPerformanceStats {Operation = _operationText, Started = SystemTime.UtcNow};
			_indexInstance.AddindexingPerformanceStat(indexingPerformanceStats);
			
			var sp = Stopwatch.StartNew();
			var enumerableDictionary = new EnumerableDictionary(documents, field, searchAnalyzer);
			spellChecker.IndexDictionary(enumerableDictionary, workContext.CancellationToken);
			
			indexingPerformanceStats.Duration = sp.Elapsed;
			indexingPerformanceStats.InputCount = enumerableDictionary.NumberOfDocuments;
			indexingPerformanceStats.ItemsCount = enumerableDictionary.NumberOfTokens;
			indexingPerformanceStats.OutputCount = enumerableDictionary.NumberOfFields;
		}
Beispiel #7
0
		protected void AddindexingPerformanceStat(IndexingPerformanceStats stats)
		{
			indexingPerformanceStats.Enqueue(stats);
			if (indexingPerformanceStats.Count > 25)
				indexingPerformanceStats.TryDequeue(out stats);
			if (stats.Operation.StartsWith("Reduce"))
			{
				perfLog.Info("Reduce.{0}.InputCount:{1}", name, stats.InputCount);
				perfLog.Info("Reduce.{0}.Duration:{1}", name, (int) stats.Duration.TotalMilliseconds);
			}
			else
			{
				perfLog.Info("Map.{0}.InputCount:{1}", name, stats.InputCount);
				perfLog.Info("Map.{0}.Duration:{1}", name, (int) stats.Duration.TotalMilliseconds);
			}
		}
Beispiel #8
0
 protected bool Equals(IndexingPerformanceStats other)
 {
     return(string.Equals(Operation, other.Operation) && OutputCount == other.OutputCount && InputCount == other.InputCount && Duration.Equals(other.Duration) && Started.Equals(other.Started));
 }
		public void SetIndexingPerformance(IndexingPerformanceStats stats)
		{
			indexingPerformanceStats = stats;
		}