Reland "iOS: Save perf results under Documents/perf_result.json"

This will require a manual roll to downstream projects, since
the //test:perf_test target was introduced.

This is a reland of 10a8e7a9b5261a7e3ce19900ba3511be3b5911f8
Original change's description:
> iOS: Save perf results under Documents/perf_result.json
>
> TBR=henrika@webrtc.org
>
> Bug: webrtc:7156
> Change-Id: Ib00992cce0007e0b5c9274340df1a892f810b0c5
> Reviewed-on: https://webrtc-review.googlesource.com/29202
> Commit-Queue: Edward Lemur <ehmaldonado@webrtc.org>
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21244}

TBR=henrika@webrtc.org, phoglund@webrtc.org

No-Try: true
Bug: webrtc:7156
Change-Id: Iecdb108f605fd1c98acde4d50ab4f5a7b5f6bfaf
Reviewed-on: https://webrtc-review.googlesource.com/32761
Reviewed-by: Edward Lemur <ehmaldonado@webrtc.org>
Commit-Queue: Edward Lemur <ehmaldonado@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21252}
This commit is contained in:
Edward Lemur
2017-12-13 13:23:17 +01:00
committed by Commit Bot
parent d37709b659
commit 8b886bb077
14 changed files with 91 additions and 22 deletions

View File

@ -12,6 +12,7 @@
#include "rtc_base/criticalsection.h"
#include <stdio.h>
#include <fstream>
#include <map>
#include <sstream>
#include <vector>
@ -154,6 +155,13 @@ std::string GetPerfResultsJSON() {
return GetPerfResultsLogger().ToJSON();
}
void WritePerfResults(const std::string& output_path) {
std::string json_results = GetPerfResultsJSON();
std::fstream json_file(output_path, std::fstream::out);
json_file << json_results;
json_file.close();
}
void PrintResult(const std::string& measurement,
const std::string& modifier,
const std::string& trace,