Exemplo n.º 1
0
        private void PrintTable(SummaryTable table, ILogger logger)
        {
            if (table.FullContent.Length == 0)
            {
                logger.WriteLineError("<pre>There are no benchmarks found</pre>");
                return;
            }

            logger.Write("<pre><code>");
            table.PrintCommonColumns(logger);
            logger.WriteLine("</code></pre>");
            logger.WriteLine();

            logger.WriteLine("<table>");

            logger.Write("<tr>");
            table.PrintLine(table.FullHeader, logger, "<th>", "</th>");
            logger.Write("</tr>");

            foreach (var line in table.FullContent)
            {
                logger.Write("<tr>");
                table.PrintLine(line, logger, "<td>", "</td>");
                logger.Write("</tr>");
            }

            logger.WriteLine("</table>");
        }
Exemplo n.º 2
0
        private void PrintTable(SummaryTable table, ILogger logger)
        {
            if (table.FullContent.Length == 0)
            {
                logger.WriteLineError("There are no benchmarks found ");
                logger.NewLine();
                return;
            }
            table.PrintCommonColumns(logger);
            logger.NewLine();

            if (useCodeBlocks)
            {
                logger.Write("```");
                logger.NewLine();
            }

            table.PrintLine(table.FullHeader, logger, "", " |");
            logger.NewLine();
            logger.WriteLineStatistic(string.Join("", table.Columns.Where(c => c.NeedToShow).Select(c => new string('-', c.Width) + " |")));
            foreach (var line in table.FullContent)
            {
                table.PrintLine(line, logger, "", " |");
                logger.NewLine();
            }
        }
        private static void PrintTable(SummaryTable table, ILogger logger)
        {
            if (table.FullContent.Length == 0)
            {
                logger.WriteLine("[WARNING]");
                logger.WriteLine("====");
                logger.WriteLineError("There are no benchmarks found ");
                logger.WriteLine("====");
                logger.WriteLine();
                return;
            }

            table.PrintCommonColumns(logger);
            logger.WriteLine("....");

            logger.WriteLine("[options=\"header\"]");
            logger.WriteLine("|===");
            table.PrintLine(table.FullHeader, logger, "|", string.Empty);
            foreach (var line in table.FullContent)
                table.PrintLine(line, logger, "|", string.Empty);
            logger.WriteLine("|===");
        }
        private void PrintTable(SummaryTable table, ILogger logger)
        {
            if (table.FullContent.Length == 0)
            {
                logger.WriteLineError("There are no benchmarks found ");
                logger.WriteLine();
                return;
            }

            table.PrintCommonColumns(logger);
            logger.WriteLine();

            if (useCodeBlocks)
            {
                logger.Write("```");
                logger.WriteLine();
            }

            table.PrintLine(table.FullHeader, logger, string.Empty, " |");
            logger.WriteLineStatistic(string.Join("", table.Columns.Where(c => c.NeedToShow).Select(c => new string('-', c.Width) + " |")));
            var rowCounter = 0;
            var highlightRow = false;
            foreach (var line in table.FullContent)
            {
                // Each time we hit the start of a new group, alternative the colour (in the console) or display bold in Markdown
                if (table.FullContentStartOfGroup[rowCounter])
                {
                    highlightRow = !highlightRow;
                }

                table.PrintLine(line, logger, string.Empty, " |", highlightRow, table.FullContentStartOfGroup[rowCounter], startOfGroupInBold);
                rowCounter++;
            }
        }