webrtc_m130/test/testsupport/perf_test_result_writer.h
Patrik Höglund 7f585b3c12 Implement histogram perf results writer.
This will be used by WebRTC tests. It converts results exactly the
same as our downstream implementation (histogram_util).

This implementation should be pretty feature complete, or at least
enough to start testing the end-to-end flow. I will set up some
experimental recipe code and see if this actually makes it into the
dashboard.

Note: needs some catapult changes to land first and be rolled
into Chromium, and then WebRTC.

Bug: chromium:1029452
Change-Id: I939046929652fc27b8fcb18af54bde22886d9228
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166172
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30436}
2020-01-31 11:38:56 +00:00

57 lines
1.8 KiB
C++

/*
* Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef TEST_TESTSUPPORT_PERF_TEST_RESULT_WRITER_H_
#define TEST_TESTSUPPORT_PERF_TEST_RESULT_WRITER_H_
#include <stdio.h>
#include <string>
#include "test/testsupport/perf_test.h"
namespace webrtc {
namespace test {
// Interface for classes that write perf results to some kind of JSON format.
class PerfTestResultWriter {
public:
virtual ~PerfTestResultWriter() = default;
virtual void ClearResults() = 0;
virtual void LogResult(const std::string& graph_name,
const std::string& trace_name,
const double value,
const std::string& units,
const bool important,
webrtc::test::ImproveDirection improve_direction) = 0;
virtual void LogResultMeanAndError(
const std::string& graph_name,
const std::string& trace_name,
const double mean,
const double error,
const std::string& units,
const bool important,
webrtc::test::ImproveDirection improve_direction) = 0;
virtual void LogResultList(
const std::string& graph_name,
const std::string& trace_name,
const rtc::ArrayView<const double> values,
const std::string& units,
const bool important,
webrtc::test::ImproveDirection improve_direction) = 0;
virtual std::string Serialize() const = 0;
};
} // namespace test
} // namespace webrtc
#endif // TEST_TESTSUPPORT_PERF_TEST_RESULT_WRITER_H_