public void Export(IList <BenchmarkReport> reports, IBenchmarkLogger logger)
        {
            var table = BenchmarkExporterHelper.BuildTable(reports, false, true);

            foreach (var line in table)
            {
                for (int i = 0; i < line.Length; i++)
                {
                    if (i != 0)
                    {
                        logger.Write(";");
                    }
                    logger.Write(line[i]);
                }
                logger.NewLine();
            }
        }
Ejemplo n.º 2
0
        public void Export(IList <BenchmarkReport> reports, IBenchmarkLogger logger)
        {
            logger.WriteLineInfo(EnvironmentHelper.GetFullEnvironmentInfo("Host", false));

            var table = BenchmarkExporterHelper.BuildTable(reports);
            // If we have Benchmarks with ParametersSets, force the "Method" columns to be displayed, otherwise it doesn't make as much sense
            var columnsToAlwaysShow = reports.Any(r => r.Benchmark.Task.ParametersSets != null) ? new[] { "Method" } : new string[0];

            PrintTable(table, logger, columnsToAlwaysShow);
            var benchmarksWithTroubles = reports.Where(r => r.Runs.Count == 0).Select(r => r.Benchmark).ToList();

            if (benchmarksWithTroubles.Count > 0)
            {
                logger.NewLine();
                logger.WriteLineError("Benchmarks with troubles:");
                foreach (var benchmarkWithTroubles in benchmarksWithTroubles)
                {
                    logger.WriteLineError("  " + benchmarkWithTroubles.Caption);
                }
            }
        }