コード例 #1
0
        public Summary(
            string title,
            ImmutableArray <BenchmarkReport> reports,
            HostEnvironmentInfo hostEnvironmentInfo,
            string resultsDirectoryPath,
            string logFilePath,
            TimeSpan totalTime,
            CultureInfo cultureInfo,
            ImmutableArray <ValidationError> validationErrors)
        {
            Title = title;
            ResultsDirectoryPath = resultsDirectoryPath;
            LogFilePath          = logFilePath;
            HostEnvironmentInfo  = hostEnvironmentInfo;
            TotalTime            = totalTime;
            ValidationErrors     = validationErrors;

            ReportMap = reports.ToImmutableDictionary(report => report.BenchmarkCase, report => report);

            DisplayPrecisionManager = new DisplayPrecisionManager(this);
            Orderer            = GetConfiguredOrdererOrDefaultOne(reports.Select(report => report.BenchmarkCase.Config));
            BenchmarksCases    = Orderer.GetSummaryOrder(reports.Select(report => report.BenchmarkCase).ToImmutableArray(), this).ToImmutableArray(); // we sort it first
            Reports            = BenchmarksCases.Select(b => ReportMap[b]).ToImmutableArray();                                                        // we use sorted collection to re-create reports list
            BaseliningStrategy = BaseliningStrategy.Create(BenchmarksCases);
            Style       = GetConfiguredSummaryStyleOrNull(BenchmarksCases)?.WithCultureInfo(cultureInfo);
            Table       = GetTable(Style);
            AllRuntimes = BuildAllRuntimes(HostEnvironmentInfo, Reports);
        }