Skip to content

Commit

Permalink
fix: Nightly SVG Footer Shows Variables Not Values (deephaven#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
stanbrub authored Feb 12, 2025
1 parent 4973ffc commit c2018f0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/main/java/io/deephaven/benchmark/run/SvgSummary.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void summarize() {
var platformProp = platformProps.get(lookupName);
var benchmark = benchmarks.get(lookupName);
if (platformProp != null)
return platformProp.getValue(columnName);
return formatPlatformValue(lookupName, platformProp.getValue(columnName));
if (benchmark != null)
return Numbers.formatNumber(benchmark.getValue(columnName));
return "$0";
Expand Down Expand Up @@ -103,10 +103,16 @@ private Map<String, Row> readSummaryCsv(URL csv, String sortColumn, boolean isNu
private String replacePlatformVars(String str) {
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
str = str.replace("${run_date}", dtf.format(LocalDateTime.now()));
str = str.replace("${os_name}", "Ubuntu 22.04.1 LTS".toLowerCase().replace(" ", "-"));
str = str.replace("${os_name}", "Ubuntu 22.04.5 LTS".toLowerCase().replace(" ", "-"));
return str.replace("${benchmark_count}", "" + benchmarks.size());
}

private String formatPlatformValue(String name, String value) {
if (name.contains(".heap"))
return Numbers.formatBytesToGigs(value);
return value;
}

class RowComparator implements Comparator<Row> {
final String sortKey;
final boolean isNumber;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void summarize() throws Exception {
<tr><td>Avg By Row1</td><td>14,915,478</td><td>9,609,994</td></tr>
<tr><td>Median By Row2</td><td>2,309,348</td><td>2,226,799</td></tr>
</tbody>
<tfoot><tr><td colspan="3">* threads=16 heap=24g os=ubuntu-22.04.1-lts benchmark-count=5</td></tr></tfoot>
<tfoot><tr><td colspan="3">* threads=16 heap=24g os=ubuntu-22.04.5-lts benchmark-count=5</td></tr></tfoot>
</table>
</div>
</foreignObject>
Expand Down

0 comments on commit c2018f0

Please sign in to comment.