Let BenchmarkReporter create a file if it doesn't exist (#5657)

CHANGELOG_BEGIN
[TestTool] Let `--perf-tests-report` attempt to create the file if it doesn't exist
CHANGELOG_END
This commit is contained in:
fabiotudone-da 2020-04-22 09:28:03 +02:00 committed by GitHub
parent 70a8e8103c
commit 94e7330628
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,8 @@ object BenchmarkReporter {
class FileOutputBenchmarkReporter(path: Path) extends BenchmarkReporter {
override def addReport(key: String, value: Double): Unit = synchronized {
val _ = Files.write(path, Seq(s"$key=$value").asJava, StandardOpenOption.APPEND)
val _ = Files
.write(path, Seq(s"$key=$value").asJava, StandardOpenOption.CREATE, StandardOpenOption.APPEND)
}
}