Add a function to report perf results in JSON format.

Add support to report perf results in the JSON format specified in [1].

[1] https://github.com/catapult-project/catapult/blob/master/dashboard/docs/data-format.md


Bug: webrtc:8566
Change-Id: I25f829a4b012b3e2a3d56d61582a674f780148d0
Reviewed-on: https://webrtc-review.googlesource.com/26031
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Edward Lemur <ehmaldonado@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20950}
This commit is contained in:
Edward Lemur
2017-11-30 11:43:42 +01:00
committed by Commit Bot
parent 30e5b26026
commit 936dfb1cb2
4 changed files with 212 additions and 47 deletions

View File

@ -8,16 +8,13 @@
* be found in the AUTHORS file in the root of the source tree.
*/
// A stripped-down version of Chromium's chrome/test/perf/perf_test.h.
// Several functions have been removed; the prototypes of the remainder have
// not been changed.
#ifndef TEST_TESTSUPPORT_PERF_TEST_H_
#define TEST_TESTSUPPORT_PERF_TEST_H_
#include "api/array_view.h"
#include <sstream>
#include <string>
#include <vector>
namespace webrtc {
namespace test {
@ -53,7 +50,6 @@ void PrintResultMeanAndError(const std::string& measurement,
const std::string& units,
bool important);
// Like PrintResult(), but prints an entire list of results. The |values|
// will generally be a list of comma-separated numbers. A typical
// post-processing step might produce plots of their mean and standard
@ -61,10 +57,17 @@ void PrintResultMeanAndError(const std::string& measurement,
void PrintResultList(const std::string& measurement,
const std::string& modifier,
const std::string& trace,
const std::vector<double>& values,
rtc::ArrayView<const double> values,
const std::string& units,
bool important);
// Get all perf results to date in a JSON format as described in
// https://github.com/catapult-project/catapult/blob/master/dashboard/docs/data-format.md
std::string GetPerfResultsJSON();
// You shouldn't use this function. It's only used to test the functions above.
void ClearPerfResults();
} // namespace test
} // namespace webrtc