Skip to content

Commit

Permalink
Added fixes for MooBench table style
Browse files Browse the repository at this point in the history
It adds two classes ``moobench-table-label`` and ``moobench-table-value``.
The added classes will look for the appropriate style in style.css.  The
original WordPress theme for kieker-monitoring.net is uploaded on the
new https://github.com/shinhyungyang/wp-theme-kieker repository, and the
fixes for the MooBench table style is committed as the
``fix-moobench-table-style`` branch on the repository.
  • Loading branch information
shinhyungyang committed Dec 4, 2024
1 parent 3727b85 commit c68ebd4
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ public GenerateHtmlTableStage(final Path tablePath) {

@Override
protected void execute(final TableInformation tableInformation) throws Exception {
String content = "<table>\n" + " <tr>\n" + " <th>setup</th>\n" + " <th>run</th>\n"
+ " <th>mean</th>\n" + " <th>ci</th>\n" + " <th>sd</th>\n" + " <th>1.quartile</th>\n"
+ " <th>median</th>\n" + " <th>3.quartile</th>\n" + " <th>max</th>\n" + " <th>min</th>\n"
String content = "<table>\n" + " <tr>\n"
+ " <th class=\"moobench-table-label\">setup</th>\n" + " <th class=\"moobench-table-label\">run</th>\n"
+ " <th class=\"moobench-table-value\">mean</th>\n" + " <th class=\"moobench-table-value\">ci</th>\n"
+ " <th class=\"moobench-table-value\">sd</th>\n" + " <th class=\"moobench-table-value\">1.quartile</th>\n"
+ " <th class=\"moobench-table-value\">median</th>\n" + " <th class=\"moobench-table-value\">3.quartile</th>\n"
+ " <th class=\"moobench-table-value\">max</th>\n" + " <th class=\"moobench-table-value\">min</th>\n"
+ " </tr>\n";
final Set<String> currentKeySet = tableInformation.getCurrent().getMeasurements().keySet();
final Set<String> previousKeySet = tableInformation.getPrevious().getMeasurements().keySet();
Expand Down Expand Up @@ -54,8 +57,8 @@ private String addMode(final String key, final Measurements current, final Measu

private String createRow(final String key, final String run, final Measurements measurements) {
final StringBuilder cells = new StringBuilder();
cells.append(String.format(" <td style=\"text-align: left;\">%s</td>\n", key));
cells.append(String.format(" <td style=\"text-align: left;\">%s</td>\n", run));
cells.append(String.format(" <td class=\"moobench-table-label\">%s</td>\n", key));
cells.append(String.format(" <td class=\"moobench-table-label\">%s</td>\n", run));

this.addDouble(cells, measurements.getMean());
this.addDouble(cells, measurements.getConvidence());
Expand All @@ -70,7 +73,7 @@ private String createRow(final String key, final String run, final Measurements
}

private StringBuilder addDouble(final StringBuilder cells, final Double value) {
return cells.append(String.format(" <td style=\"text-align: right;\">%1.3f</td>\n", value));
return cells.append(String.format(" <td class=\"moobench-table-value\">%1.3f</td>\n", value));
}

}

0 comments on commit c68ebd4

Please sign in to comment.