Created
January 22, 2019 11:01
-
-
Save steveloughran/774a8cb81aeabc86a32db16a654ef63c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void test_140_teracomplete() throws Throwable { | |
terasortDuration.get().close(); | |
final StringBuilder results = new StringBuilder(); | |
results.append("\"Operation\"\t\"Duration\"\n"); | |
// this is how you dynamically create a function in a method | |
// for use afterwards. | |
// Works because there's no IOEs being raised in this sequence. | |
BiConsumer<String, Optional<DurationInfo>> stage = | |
(s, od) -> | |
results.append(String.format("\"%s\"\t\"%s\"\n", | |
s, | |
od.map(DurationInfo::getDurationString).orElse(""))); | |
stage.accept("Generate", teragenStageDuration); | |
stage.accept("Terasort", terasortStageDuration); | |
stage.accept("Validate", teravalidateStageDuration); | |
stage.accept("Completed", terasortDuration); | |
String text = results.toString(); | |
Path path = new Path(terasortPath, "results.csv"); | |
LOG.info("Results are in {}\n{}", path, text); | |
ContractTestUtils.writeTextFile(getFileSystem(), path, text, true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment