fix broken columns

v1
Brett 2023-12-03 17:08:37 -05:00
parent de84f9573b
commit cfa9494ffc
3 changed files with 24 additions and 16 deletions

View File

@ -123,12 +123,12 @@ namespace blt::profiling {
orderIntervals(averageHistory ? averaged_intervals : intervals, ordered_rows, averageHistory); orderIntervals(averageHistory ? averaged_intervals : intervals, ordered_rows, averageHistory);
string::TableFormatter formatter{profileName}; string::TableFormatter formatter{profileName};
formatter.addColumn({"Order"}); formatter.addColumn("Order");
formatter.addColumn({"Count"}); formatter.addColumn("Count");
formatter.addColumn({"Interval"}); formatter.addColumn("Interval");
formatter.addColumn({"Time (ms)"}); formatter.addColumn("Time (ms)");
formatter.addColumn({"Time (ns)"}); formatter.addColumn("Time (ns)");
formatter.addColumn({"Total (ms)"}); formatter.addColumn("Total (ms)");
int index = 1; int index = 1;
for (const auto& row : ordered_rows) { for (const auto& row : ordered_rows) {

View File

@ -164,16 +164,16 @@ namespace blt
auto wall_unit_divide = units.wall == unit::MS ? 1e6 : units.wall == unit::NS ? 1 : 1e9; auto wall_unit_divide = units.wall == unit::MS ? 1e6 : units.wall == unit::NS ? 1 : 1e9;
string::TableFormatter formatter{profiler.name}; string::TableFormatter formatter{profiler.name};
formatter.addColumn({"Order"}); formatter.addColumn("Order");
if (printHistory) if (printHistory)
formatter.addColumn({"Count"}); formatter.addColumn("Count");
formatter.addColumn({"Interval"}); formatter.addColumn("Interval");
if (printCycles) if (printCycles)
formatter.addColumn({"Cycles"}); formatter.addColumn("Cycles");
if (printThread) if (printThread)
formatter.addColumn({"CPU Time (" + thread_unit_string += ")"}); formatter.addColumn("CPU Time (" + thread_unit_string += ")");
if (printWall) if (printWall)
formatter.addColumn({"Wall Time (" + wall_unit_string += ")"}); formatter.addColumn("Wall Time (" + wall_unit_string += ")");
for (size_t i = 0; i < profiler.intervals.size(); i++) for (size_t i = 0; i < profiler.intervals.size(); i++)
{ {

View File

@ -45,8 +45,8 @@ void blt::test::utility::run()
} }
blt::string::TableFormatter tableTest("Intrinsic Action Value Table"); blt::string::TableFormatter tableTest("Intrinsic Action Value Table");
tableTest.addColumn({"Thing"}); tableTest.addColumn("Thing");
tableTest.addColumn({"Value"}); tableTest.addColumn("Value");
tableTest.addRow({"Cuddles", "1 / minute"}); tableTest.addRow({"Cuddles", "1 / minute"});
tableTest.addRow({"Hand Job", "10"}); tableTest.addRow({"Hand Job", "10"});
@ -85,9 +85,17 @@ void blt::test::utility::run()
); );
printLines(assign1.construct()); printLines(assign1.construct());
blt::string::TableFormatter tableQ2i1("Iteration 1"); blt::string::TableFormatter tableQ2i1("Iteration 0");
tableQ2i1.addColumn("Statement");
tableQ2i1.addColumn("Statement"); tableQ2i1.addColumn("Statement");
tableQ2i1.addColumn("IN");
tableQ2i1.addColumn("OUT");
tableQ2i1.addRow({"Entry (0)", "{}", "{}"});
tableQ2i1.addRow({"(1)", "{}", "{}"});
tableQ2i1.addRow({"(2)", "{}", "{}"});
tableQ2i1.addRow({"(3)", "{}", "{}"});
tableQ2i1.addRow({"(4)", "{}", "{}"});
tableQ2i1.addRow({"(5)", "{}", "{}"});
tableQ2i1.addRow({"Exit (6)", "{}", "{}"});
printLines(tableQ2i1.createTable(true, true)); printLines(tableQ2i1.createTable(true, true));
} }