Пример #1
0
        private async Task ShowAnalysisResult(ILogAnalysis analysis, LogDirectory logDirectory)
        {
            await ExecuteTimedLongTask($"Début [{analysis.Name}] dans {logDirectory.Name}...",
                                       "Temps de calcul",
                                       () => AnalyseDirectory(analysis));

            WriteLineToConsole($"Taille totale des logs : {logDirectory.GetSize() / Mega} MB");
        }
Пример #2
0
        private void AnalyseDirectory(ILogAnalysis analysis)
        {
            IEnumerable <LogEntry> logEntries;

            if (analysis.CanBeParalelyzed)
            {
                logEntries = SelectedLogDirectory.ReadParallel(analysis.Filter);
            }
            else
            {
                logEntries = SelectedLogDirectory.ReadSequential(analysis.Filter);
            }

            SetOutput(analysis.AnalyseLogs(logEntries));
        }