1 /* 2 * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef TEST_TESTSUPPORT_PERF_TEST_RESULT_WRITER_H_ 12 #define TEST_TESTSUPPORT_PERF_TEST_RESULT_WRITER_H_ 13 14 #include <stdio.h> 15 #include <string> 16 17 #include "test/testsupport/perf_test.h" 18 19 namespace webrtc { 20 namespace test { 21 22 // Interface for classes that write perf results to some kind of JSON format. 23 class PerfTestResultWriter { 24 public: 25 virtual ~PerfTestResultWriter() = default; 26 27 virtual void ClearResults() = 0; 28 virtual void LogResult(const std::string& graph_name, 29 const std::string& trace_name, 30 const double value, 31 const std::string& units, 32 const bool important, 33 webrtc::test::ImproveDirection improve_direction) = 0; 34 virtual void LogResultMeanAndError( 35 const std::string& graph_name, 36 const std::string& trace_name, 37 const double mean, 38 const double error, 39 const std::string& units, 40 const bool important, 41 webrtc::test::ImproveDirection improve_direction) = 0; 42 virtual void LogResultList( 43 const std::string& graph_name, 44 const std::string& trace_name, 45 const rtc::ArrayView<const double> values, 46 const std::string& units, 47 const bool important, 48 webrtc::test::ImproveDirection improve_direction) = 0; 49 50 virtual std::string Serialize() const = 0; 51 }; 52 53 } // namespace test 54 } // namespace webrtc 55 56 #endif // TEST_TESTSUPPORT_PERF_TEST_RESULT_WRITER_H_ 57