1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_WEBRTC_BROWSERTEST_PERF_H_
6 #define CHROME_BROWSER_MEDIA_WEBRTC_WEBRTC_BROWSERTEST_PERF_H_
7 
8 #include <string>
9 
10 namespace base {
11 class DictionaryValue;
12 }
13 
14 namespace test {
15 
16 // These functions takes parsed data (on one peer connection) from the
17 // peerConnectionDataStore object that is backing webrtc-internals and prints
18 // metrics they consider interesting using testing/perf/perf_test.h primitives.
19 // The idea is to put as many webrtc-related metrics as possible into the
20 // dashboard and thereby track it for regressions.
21 //
22 // These functions expect to run under googletest and will use EXPECT_ and
23 // ASSERT_ macros to signal failure. They take as argument one peer connection's
24 // stats data and a |modifier| to append to each result bucket. For instance, if
25 // the modifier is '_oneway', the rtt stat will be logged as goog_rtt in
26 // the video_tx_oneway bucket.
27 // If |video_codec| is a non-empty string, the codec name is appended last for
28 // video metrics, e.g. 'video_tx_oneway_VP9'.
29 void PrintBweForVideoMetrics(const base::DictionaryValue& pc_dict,
30                              const std::string& modifier,
31                              const std::string& video_codec);
32 void PrintMetricsForAllStreams(const base::DictionaryValue& pc_dict,
33                                const std::string& modifier,
34                                const std::string& video_codec);
35 void PrintMetricsForSendStreams(const base::DictionaryValue& pc_dict,
36                                 const std::string& modifier,
37                                 const std::string& video_codec);
38 void PrintMetricsForRecvStreams(const base::DictionaryValue& pc_dict,
39                                 const std::string& modifier,
40                                 const std::string& video_codec);
41 
42 bool WriteCompareVideosOutputAsHistogram(const std::string& test_label,
43                                          const std::string& output);
44 
45 }  // namespace test
46 
47 #endif  // CHROME_BROWSER_MEDIA_WEBRTC_WEBRTC_BROWSERTEST_PERF_H_
48