use of com.codingchili.core.benchmarking.reporting.BenchmarkHTMLReport in project chili-core by codingchili.
the class BenchmarkIT method testBenchmarkBuilders.
@Test
public void testBenchmarkBuilders(TestContext test) {
Async async = test.async();
List<BenchmarkGroup> groups = new ArrayList<>();
BiConsumer<BenchmarkGroup, String> addOneOperation = (group, implementation) -> {
group.implementation(implementation).add("sleep1x", Promise::complete).add("sleep2x", Promise::complete);
};
BiConsumer<String, Integer> addOneGroup = (name, iterations) -> {
BenchmarkGroup group = new BenchmarkGroupBuilder(name, iterations);
addOneOperation.accept(group, "fastImplementation");
addOneOperation.accept(group, "slowImplementation");
groups.add(group);
};
addOneGroup.accept("group_1", ITERATIONS);
addOneGroup.accept("group_2", ITERATIONS);
addOneGroup.accept("group_3", ITERATIONS);
new BenchmarkExecutor(context).start(groups).onComplete(done -> {
new BenchmarkHTMLReport(done.result()).saveTo("wowza.html");
async.complete();
});
}
use of com.codingchili.core.benchmarking.reporting.BenchmarkHTMLReport in project chili-core by codingchili.
the class BenchmarkHTMLReportTest method setUp.
@Before
public void setUp() {
super.setUp();
report = new BenchmarkHTMLReport(groups);
report.template("/main/resources/benchmarking/report.jade");
}
use of com.codingchili.core.benchmarking.reporting.BenchmarkHTMLReport in project chili-core by codingchili.
the class CoreBenchmarkSuite method createReport.
private void createReport(Promise<CommandResult> future, List<BenchmarkGroup> result, CommandExecutor executor) {
Optional<String> template = executor.getProperty(PARAM_TEMPLATE);
BenchmarkReport report;
if (executor.hasProperty(PARAM_HTML)) {
report = new BenchmarkHTMLReport(result);
} else {
report = new BenchmarkConsoleReport(result);
}
template.ifPresent(report::template);
report.display();
future.complete(LauncherCommandResult.SHUTDOWN);
}
Aggregations