Exemplo n.º 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);
        }
Exemplo n.º 2
0
        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;
            BenchmarksCases = orderer.GetSummaryOrder(BenchmarksCases, this).ToArray();
            Reports         = BenchmarksCases.Select(b => reportMap[b]).ToArray();

            Style       = config.GetSummaryStyle();
            Table       = GetTable(Style);
            AllRuntimes = BuildAllRuntimes();
        }
Exemplo n.º 3
0
 public bool HasBaselines() => BenchmarksCases.Any(IsBaseline);
Exemplo n.º 4
0
 public IEnumerable <BenchmarkCase> GetNonBaselines(string logicalGroupKey)
 => BenchmarksCases
 .Where(b => GetLogicalGroupKey(b) == logicalGroupKey)
 .Where(b => !IsBaseline(b));
Exemplo n.º 5
0
 public BenchmarkCase GetBaseline(string logicalGroupKey)
 => BenchmarksCases
 .Where(b => GetLogicalGroupKey(b) == logicalGroupKey)
 .FirstOrDefault(IsBaseline);