Skip to content

Commit

Permalink
perf_tests: Right-align numeric metrics in markdown tables
Browse files Browse the repository at this point in the history
Right-align metrics columns in markdown output for better number comparison.
Previously, metrics were left-aligned in markdown tables but right-aligned
in stdout, making it difficult to visually compare numbers.

The change adds colons to the right of hyphens in the header row
(e.g. `|---:|`) to right-align entire columns. While this affects both
headers and data cells, the improved readability of numeric values
outweighs the minor tradeoff of right-aligned headers.

In short:
- Uses `column::print_text` with ":>" alignment for consistent formatting
- Maintains existing stdout_printer right alignment
- Updates `markdown_printer` alignment to match stdout behavior

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Jan 16, 2025
1 parent 57d7d48 commit 94ffbb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/perf/perf_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class markdown_printer final : public result_printer {
void print_configuration(const config&) override {
// print the header row, then the divider row of all -
print_text_header(_output, text_columns, name_column_length(), "| ", " | ", " |", "test");
print_text_header(_output, text_columns, name_column_length(), "| ", " | ", " |", "test", "-");
print_text_header(_output, text_columns, name_column_length(), "| ", " | ", " |", "test", "-:");
}

void print_result(const result& r) override {
Expand Down

0 comments on commit 94ffbb0

Please sign in to comment.