Skip to content

Commit

Permalink
Tabulated markdown report?
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdanfox committed Feb 17, 2020
1 parent 0c0560c commit 4e2b200
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,9 @@ public void after() throws IOException {
"%s success=%.0f%% client_mean=%.1f ms server_cpu=%s",
strategy, result.successPercentage(), clientMeanMillis, serverCpu));
XYChart serverRequestCount = simulation.metrics().chart(Pattern.compile("request.*count"));
XYChart clientStuff = simulation.metrics().chart(Pattern.compile("(refusals|starts).count"));
// XYChart clientStuff = simulation.metrics().chart(Pattern.compile("(refusals|starts).count"));

SimulationMetrics.png(pngPath, activeRequests, serverRequestCount, clientStuff);
SimulationMetrics.png(pngPath, activeRequests, serverRequestCount);
log.info("Generated {} ({} ms)", pngPath, sw.elapsed(TimeUnit.MILLISECONDS));
}
}
Expand All @@ -470,14 +470,19 @@ public static void afterClass() throws IOException {
})
.collect(Collectors.joining("", "```\n", "```\n"));

String images = files.stream()
.filter(p -> p.toString().endsWith("png"))
.map(p -> String.format("## %s%n![%s](%s)%n", p.getFileName(), p.getFileName(), p.getFileName()))
.collect(Collectors.joining());
String images = "<table><tr><th>develop</th><th>current</th></tr>"
+ files.stream()
.filter(p -> p.toString().endsWith("png"))
.map(p -> String.format(
"<tr><td><image src=\"https://raw.githubusercontent"
+ ".com/palantir/dialogue/develop/simulation/src/test/resources/%s\" "
+ "/></td><td>%s<image src=\"%s\" /></td></tr>%n",
p.getFileName(), p.getFileName(), p.getFileName()))
.collect(Collectors.joining())
+ "</table>";

String report = String.format(
"# Report%n<!-- Run SimulationTest to regenerate this report. -->%n%s%n%n%s%n",
txtSection, images);
"# Report%n<!-- Run SimulationTest to regenerate this report. -->%n%s%n%n%s%n", txtSection, images);
Files.write(Paths.get("src/test/resources/report.md"), report.getBytes(StandardCharsets.UTF_8));
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified simulation/src/test/resources/all_nodes_500[ROUND_ROBIN].png
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.
Binary file modified simulation/src/test/resources/black_hole[ROUND_ROBIN].png
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.
Binary file modified simulation/src/test/resources/drastic_slowdown[ROUND_ROBIN].png
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.
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.
Binary file modified simulation/src/test/resources/live_reloading[ROUND_ROBIN].png
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 19 additions & 37 deletions simulation/src/test/resources/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,22 @@
```


## all_nodes_500[CONCURRENCY_LIMITER].png
![all_nodes_500[CONCURRENCY_LIMITER].png](all_nodes_500[CONCURRENCY_LIMITER].png)
## all_nodes_500[ROUND_ROBIN].png
![all_nodes_500[ROUND_ROBIN].png](all_nodes_500[ROUND_ROBIN].png)
## black_hole[CONCURRENCY_LIMITER].png
![black_hole[CONCURRENCY_LIMITER].png](black_hole[CONCURRENCY_LIMITER].png)
## black_hole[ROUND_ROBIN].png
![black_hole[ROUND_ROBIN].png](black_hole[ROUND_ROBIN].png)
## drastic_slowdown[CONCURRENCY_LIMITER].png
![drastic_slowdown[CONCURRENCY_LIMITER].png](drastic_slowdown[CONCURRENCY_LIMITER].png)
## drastic_slowdown[ROUND_ROBIN].png
![drastic_slowdown[ROUND_ROBIN].png](drastic_slowdown[ROUND_ROBIN].png)
## fast_500s_then_revert[CONCURRENCY_LIMITER].png
![fast_500s_then_revert[CONCURRENCY_LIMITER].png](fast_500s_then_revert[CONCURRENCY_LIMITER].png)
## fast_500s_then_revert[ROUND_ROBIN].png
![fast_500s_then_revert[ROUND_ROBIN].png](fast_500s_then_revert[ROUND_ROBIN].png)
## live_reloading[CONCURRENCY_LIMITER].png
![live_reloading[CONCURRENCY_LIMITER].png](live_reloading[CONCURRENCY_LIMITER].png)
## live_reloading[ROUND_ROBIN].png
![live_reloading[ROUND_ROBIN].png](live_reloading[ROUND_ROBIN].png)
## one_endpoint_dies_on_each_server[CONCURRENCY_LIMITER].png
![one_endpoint_dies_on_each_server[CONCURRENCY_LIMITER].png](one_endpoint_dies_on_each_server[CONCURRENCY_LIMITER].png)
## one_endpoint_dies_on_each_server[ROUND_ROBIN].png
![one_endpoint_dies_on_each_server[ROUND_ROBIN].png](one_endpoint_dies_on_each_server[ROUND_ROBIN].png)
## simplest_possible_case[CONCURRENCY_LIMITER].png
![simplest_possible_case[CONCURRENCY_LIMITER].png](simplest_possible_case[CONCURRENCY_LIMITER].png)
## simplest_possible_case[ROUND_ROBIN].png
![simplest_possible_case[ROUND_ROBIN].png](simplest_possible_case[ROUND_ROBIN].png)
## slow_503s_then_revert[CONCURRENCY_LIMITER].png
![slow_503s_then_revert[CONCURRENCY_LIMITER].png](slow_503s_then_revert[CONCURRENCY_LIMITER].png)
## slow_503s_then_revert[ROUND_ROBIN].png
![slow_503s_then_revert[ROUND_ROBIN].png](slow_503s_then_revert[ROUND_ROBIN].png)
## slowdown_and_error_thresholds[CONCURRENCY_LIMITER].png
![slowdown_and_error_thresholds[CONCURRENCY_LIMITER].png](slowdown_and_error_thresholds[CONCURRENCY_LIMITER].png)
## slowdown_and_error_thresholds[ROUND_ROBIN].png
![slowdown_and_error_thresholds[ROUND_ROBIN].png](slowdown_and_error_thresholds[ROUND_ROBIN].png)

<table><tr><th>develop</th><th>current</th></tr><tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/all_nodes_500[CONCURRENCY_LIMITER].png" /></td><td>all_nodes_500[CONCURRENCY_LIMITER].png<image src="all_nodes_500[CONCURRENCY_LIMITER].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/all_nodes_500[ROUND_ROBIN].png" /></td><td>all_nodes_500[ROUND_ROBIN].png<image src="all_nodes_500[ROUND_ROBIN].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/black_hole[CONCURRENCY_LIMITER].png" /></td><td>black_hole[CONCURRENCY_LIMITER].png<image src="black_hole[CONCURRENCY_LIMITER].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/black_hole[ROUND_ROBIN].png" /></td><td>black_hole[ROUND_ROBIN].png<image src="black_hole[ROUND_ROBIN].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/drastic_slowdown[CONCURRENCY_LIMITER].png" /></td><td>drastic_slowdown[CONCURRENCY_LIMITER].png<image src="drastic_slowdown[CONCURRENCY_LIMITER].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/drastic_slowdown[ROUND_ROBIN].png" /></td><td>drastic_slowdown[ROUND_ROBIN].png<image src="drastic_slowdown[ROUND_ROBIN].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/fast_500s_then_revert[CONCURRENCY_LIMITER].png" /></td><td>fast_500s_then_revert[CONCURRENCY_LIMITER].png<image src="fast_500s_then_revert[CONCURRENCY_LIMITER].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/fast_500s_then_revert[ROUND_ROBIN].png" /></td><td>fast_500s_then_revert[ROUND_ROBIN].png<image src="fast_500s_then_revert[ROUND_ROBIN].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/live_reloading[CONCURRENCY_LIMITER].png" /></td><td>live_reloading[CONCURRENCY_LIMITER].png<image src="live_reloading[CONCURRENCY_LIMITER].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/live_reloading[ROUND_ROBIN].png" /></td><td>live_reloading[ROUND_ROBIN].png<image src="live_reloading[ROUND_ROBIN].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/one_endpoint_dies_on_each_server[CONCURRENCY_LIMITER].png" /></td><td>one_endpoint_dies_on_each_server[CONCURRENCY_LIMITER].png<image src="one_endpoint_dies_on_each_server[CONCURRENCY_LIMITER].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/one_endpoint_dies_on_each_server[ROUND_ROBIN].png" /></td><td>one_endpoint_dies_on_each_server[ROUND_ROBIN].png<image src="one_endpoint_dies_on_each_server[ROUND_ROBIN].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/simplest_possible_case[CONCURRENCY_LIMITER].png" /></td><td>simplest_possible_case[CONCURRENCY_LIMITER].png<image src="simplest_possible_case[CONCURRENCY_LIMITER].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/simplest_possible_case[ROUND_ROBIN].png" /></td><td>simplest_possible_case[ROUND_ROBIN].png<image src="simplest_possible_case[ROUND_ROBIN].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/slow_503s_then_revert[CONCURRENCY_LIMITER].png" /></td><td>slow_503s_then_revert[CONCURRENCY_LIMITER].png<image src="slow_503s_then_revert[CONCURRENCY_LIMITER].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/slow_503s_then_revert[ROUND_ROBIN].png" /></td><td>slow_503s_then_revert[ROUND_ROBIN].png<image src="slow_503s_then_revert[ROUND_ROBIN].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/slowdown_and_error_thresholds[CONCURRENCY_LIMITER].png" /></td><td>slowdown_and_error_thresholds[CONCURRENCY_LIMITER].png<image src="slowdown_and_error_thresholds[CONCURRENCY_LIMITER].png" /></td></tr>
<tr><td><image src="https://raw.githubusercontent.com/palantir/dialogue/develop/simulation/src/test/resources/slowdown_and_error_thresholds[ROUND_ROBIN].png" /></td><td>slowdown_and_error_thresholds[ROUND_ROBIN].png<image src="slowdown_and_error_thresholds[ROUND_ROBIN].png" /></td></tr>
</table>
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.
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.
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.

0 comments on commit 4e2b200

Please sign in to comment.