コード例 #1
0
        public IndexingPerformanceOperation ToIndexingPerformanceOperation(string name)
        {
            var operation = new IndexingPerformanceOperation(Duration)
            {
                Name = name
            };

            if (_stats.ReduceDetails != null && name == IndexingOperation.Reduce.TreeScope)
            {
                operation.ReduceDetails = _stats.ReduceDetails;
            }

            if (_stats.MapDetails != null && name == "Map")
            {
                operation.MapDetails = _stats.MapDetails;
            }

            if (_stats.CommitDetails != null && name == IndexingOperation.Storage.Commit)
            {
                operation.CommitDetails = _stats.CommitDetails;
            }

            if (Scopes != null)
            {
                operation.Operations = Scopes
                                       .Select(x => x.Value.ToIndexingPerformanceOperation(x.Key))
                                       .ToArray();
            }

            return(operation);
        }
コード例 #2
0
        public IndexingPerformanceOperation ToIndexingPerformanceOperation(string name)
        {
            var operation = new IndexingPerformanceOperation(Duration)
            {
                Name = name
            };

            if (_stats.ReduceDetails != null && name == "Reduce")
            {
                operation.ReduceDetails = new ReduceRunDetails
                {
                    ProcessWorkingSet    = _stats.ReduceDetails.ProcessWorkingSet,
                    ProcessPrivateMemory = _stats.ReduceDetails.ProcessPrivateMemory,
                    CurrentlyAllocated   = _stats.ReduceDetails.CurrentlyAllocated,
                    ReduceAttempts       = _stats.ReduceAttempts,
                    ReduceSuccesses      = _stats.ReduceSuccesses,
                    ReduceErrors         = _stats.ReduceErrors,
                };
            }

            if (_stats.ReduceDetails != null && name == IndexingOperation.Reduce.TreeScope)
            {
                operation.ReduceDetails = new ReduceRunDetails
                {
                    TreesReduceDetails = _stats.ReduceDetails.TreesReduceDetails
                };
            }

            if (_stats.MapDetails != null && name == "Map")
            {
                operation.MapDetails = _stats.MapDetails;
            }

            if (_stats.LuceneMergeDetails != null && name == IndexingOperation.Lucene.Merge)
            {
                operation.LuceneMergeDetails = _stats.LuceneMergeDetails;
            }

            if (_stats.CommitDetails != null && name == IndexingOperation.Storage.Commit)
            {
                operation.CommitDetails = _stats.CommitDetails;
            }

            if (Scopes != null)
            {
                operation.Operations = Scopes
                                       .Select(x => x.Value.ToIndexingPerformanceOperation(x.Key))
                                       .ToArray();
            }

            return(operation);
        }