Beispiel #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);
        }
        public Summary(string title,
                       IList <BenchmarkReport> reports,
                       HostEnvironmentInfo hostEnvironmentInfo,
                       IConfig config, string resultsDirectoryPath,
                       TimeSpan totalTime,
                       ValidationError[] validationErrors)
            : this(title, hostEnvironmentInfo, config, resultsDirectoryPath, totalTime, validationErrors)
        {
            BenchmarksCases = reports.Select(r => r.BenchmarkCase).ToArray();
            foreach (var report in reports)
            {
                reportMap[report.BenchmarkCase] = report;
            }
            Reports = BenchmarksCases.Select(b => reportMap[b]).ToArray();

            orderer            = config.GetOrderer() ?? DefaultOrderer.Instance;
            baseliningStrategy = BaseliningStrategy.Create(BenchmarksCases);
            BenchmarksCases    = orderer.GetSummaryOrder(BenchmarksCases, this).ToArray();
            Reports            = BenchmarksCases.Select(b => reportMap[b]).ToArray();

            Style       = config.GetSummaryStyle();
            Table       = GetTable(Style);
            AllRuntimes = BuildAllRuntimes();
        }
Beispiel #3
0
 public bool IsBaseline(BenchmarkCase benchmarkCase)
 => BaseliningStrategy.IsBaseline(benchmarkCase);