public void ReportIndexingBatchStarted(int documentsCount, long documentsSize) { var indexingBatchInfo = new IndexingBatchInfo { TotalDocumentCount = documentsCount, TotalDocumentSize = documentsSize, Timestamp = SystemTime.UtcNow }; lastActualIndexingBatchInfo.Add(indexingBatchInfo); }
public void ReportIndexingBatchCompleted(IndexingBatchInfo batchInfo) { batchInfo.BatchCompleted(); lastActualIndexingBatchInfo.Add(batchInfo); }
private Etag DoActualIndexing(IList<IndexToWorkOn> indexesToWorkOn, List<JsonDocument> jsonDocs, IndexingBatchInfo indexingBatchInfo) { var lastByEtag = PrefetchingBehavior.GetHighestJsonDocumentByEtag(jsonDocs); var lastModified = lastByEtag.LastModified.Value; var lastEtag = lastByEtag.Etag; context.MetricsCounters.IndexedPerSecond.Mark(jsonDocs.Count); var result = FilterIndexes(indexesToWorkOn, jsonDocs, lastEtag).OrderByDescending(x => x.Index.LastQueryTime).ToList(); BackgroundTaskExecuter.Instance.ExecuteAllInterleaved(context, result, index => { using (LogContext.WithDatabase(context.DatabaseName)) { var performance = HandleIndexingFor(index, lastEtag, lastModified, context.CancellationToken); if (performance != null) indexingBatchInfo.PerformanceStats.TryAdd(index.Index.PublicName, performance); } }); return lastEtag; }
public void ReportIndexingBatchStarted(int documentsCount, long documentsSize, List<string> indexesToWorkOn, out IndexingBatchInfo indexingBatchInfo) { indexingBatchInfo = new IndexingBatchInfo { IndexesToWorkOn = indexesToWorkOn, TotalDocumentCount = documentsCount, TotalDocumentSize = documentsSize, StartedAt = SystemTime.UtcNow, PerformanceStats = new ConcurrentDictionary<string, IndexingPerformanceStats>() }; lastActualIndexingBatchInfo.Add(indexingBatchInfo); }