terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 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 | |
Mirko Bonadei | 575998c | 2019-07-25 13:57:41 +0200 | [diff] [blame] | 11 | #ifndef RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_ANALYZER_H_ |
| 12 | #define RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_ANALYZER_H_ |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 13 | |
terelius | 88e64e5 | 2016-07-19 01:51:06 -0700 | [diff] [blame] | 14 | #include <map> |
Stefan Holmer | 1318103 | 2016-07-29 14:48:54 +0200 | [diff] [blame] | 15 | #include <memory> |
terelius | 0740a20 | 2016-08-08 10:21:04 -0700 | [diff] [blame] | 16 | #include <set> |
philipel | ccd7489 | 2016-09-05 02:46:25 -0700 | [diff] [blame] | 17 | #include <string> |
Stefan Holmer | 1318103 | 2016-07-29 14:48:54 +0200 | [diff] [blame] | 18 | #include <utility> |
philipel | ccd7489 | 2016-09-05 02:46:25 -0700 | [diff] [blame] | 19 | #include <vector> |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 20 | |
Sebastian Jansson | b290a6d | 2019-01-03 14:46:23 +0100 | [diff] [blame] | 21 | #include "logging/rtc_event_log/rtc_event_log_parser.h" |
Minyue Li | c6ff757 | 2018-05-04 09:46:44 +0200 | [diff] [blame] | 22 | #include "modules/audio_coding/neteq/tools/neteq_stats_getter.h" |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 23 | #include "rtc_base/strings/string_builder.h" |
Bjorn Terelius | 48b8279 | 2020-05-19 10:57:24 +0200 | [diff] [blame] | 24 | #include "rtc_tools/rtc_event_log_visualizer/analyzer_common.h" |
Mirko Bonadei | 575998c | 2019-07-25 13:57:41 +0200 | [diff] [blame] | 25 | #include "rtc_tools/rtc_event_log_visualizer/plot_base.h" |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 26 | |
| 27 | namespace webrtc { |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 28 | |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 29 | class EventLogAnalyzer { |
| 30 | public: |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 31 | // The EventLogAnalyzer keeps a reference to the ParsedRtcEventLogNew for the |
| 32 | // duration of its lifetime. The ParsedRtcEventLogNew must not be destroyed or |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 33 | // modified while the EventLogAnalyzer is being used. |
Sebastian Jansson | b290a6d | 2019-01-03 14:46:23 +0100 | [diff] [blame] | 34 | EventLogAnalyzer(const ParsedRtcEventLog& log, bool normalize_time); |
Bjorn Terelius | 48b8279 | 2020-05-19 10:57:24 +0200 | [diff] [blame] | 35 | EventLogAnalyzer(const ParsedRtcEventLog& log, const AnalyzerConfig& config); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 36 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 37 | void CreatePacketGraph(PacketDirection direction, Plot* plot); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 38 | |
Bjorn Terelius | 7c974e6 | 2019-02-15 17:20:12 +0100 | [diff] [blame] | 39 | void CreateRtcpTypeGraph(PacketDirection direction, Plot* plot); |
| 40 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 41 | void CreateAccumulatedPacketsGraph(PacketDirection direction, Plot* plot); |
philipel | ccd7489 | 2016-09-05 02:46:25 -0700 | [diff] [blame] | 42 | |
Kristoffer Erlandsson | 283c106 | 2020-03-30 13:01:37 +0200 | [diff] [blame] | 43 | void CreatePacketRateGraph(PacketDirection direction, Plot* plot); |
| 44 | |
Kristoffer Erlandsson | a2ce423 | 2020-04-01 14:33:30 +0200 | [diff] [blame] | 45 | void CreateTotalPacketRateGraph(PacketDirection direction, Plot* plot); |
| 46 | |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 47 | void CreatePlayoutGraph(Plot* plot); |
| 48 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 49 | void CreateAudioLevelGraph(PacketDirection direction, Plot* plot); |
ivoc | aac9d6f | 2016-09-22 07:01:47 -0700 | [diff] [blame] | 50 | |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 51 | void CreateSequenceNumberGraph(Plot* plot); |
| 52 | |
Stefan Holmer | 99f8e08 | 2016-09-09 13:37:50 +0200 | [diff] [blame] | 53 | void CreateIncomingPacketLossGraph(Plot* plot); |
| 54 | |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 55 | void CreateIncomingDelayGraph(Plot* plot); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 56 | |
terelius | f736d23 | 2016-08-04 10:00:11 -0700 | [diff] [blame] | 57 | void CreateFractionLossGraph(Plot* plot); |
| 58 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 59 | void CreateTotalIncomingBitrateGraph(Plot* plot); |
| 60 | void CreateTotalOutgoingBitrateGraph(Plot* plot, |
| 61 | bool show_detector_state = false, |
Diep Bui | 38b3cf0 | 2022-07-19 14:09:45 +0200 | [diff] [blame] | 62 | bool show_alr_state = false, |
| 63 | bool show_link_capacity = false); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 64 | |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 65 | void CreateStreamBitrateGraph(PacketDirection direction, Plot* plot); |
Bjorn Terelius | 9775a58 | 2019-02-15 17:29:58 +0100 | [diff] [blame] | 66 | void CreateBitrateAllocationGraph(PacketDirection direction, Plot* plot); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 67 | |
Sebastian Jansson | 1175ae0 | 2019-03-13 08:56:58 +0100 | [diff] [blame] | 68 | void CreateGoogCcSimulationGraph(Plot* plot); |
Bjorn Terelius | 28db266 | 2017-10-04 14:22:43 +0200 | [diff] [blame] | 69 | void CreateSendSideBweSimulationGraph(Plot* plot); |
| 70 | void CreateReceiveSideBweSimulationGraph(Plot* plot); |
Stefan Holmer | 1318103 | 2016-07-29 14:48:54 +0200 | [diff] [blame] | 71 | |
terelius | e34c19c | 2016-08-15 08:47:14 -0700 | [diff] [blame] | 72 | void CreateNetworkDelayFeedbackGraph(Plot* plot); |
Bjorn Terelius | 0295a96 | 2017-10-25 17:42:41 +0200 | [diff] [blame] | 73 | void CreatePacerDelayGraph(Plot* plot); |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 74 | |
| 75 | void CreateTimestampGraph(PacketDirection direction, Plot* plot); |
Bjorn Terelius | b1222c2 | 2018-07-24 13:45:31 +0200 | [diff] [blame] | 76 | void CreateSenderAndReceiverReportPlot( |
| 77 | PacketDirection direction, |
| 78 | rtc::FunctionView<float(const rtcp::ReportBlock&)> fy, |
| 79 | std::string title, |
| 80 | std::string yaxis_label, |
| 81 | Plot* plot); |
stefan | c3de033 | 2016-08-02 07:22:17 -0700 | [diff] [blame] | 82 | |
Qingsi Wang | 8eca1ff | 2018-02-02 11:49:44 -0800 | [diff] [blame] | 83 | void CreateIceCandidatePairConfigGraph(Plot* plot); |
| 84 | void CreateIceConnectivityCheckGraph(Plot* plot); |
| 85 | |
Zach Stein | 10a5801 | 2018-12-07 12:26:28 -0800 | [diff] [blame] | 86 | void CreateDtlsTransportStateGraph(Plot* plot); |
| 87 | void CreateDtlsWritableStateGraph(Plot* plot); |
| 88 | |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 89 | void CreateTriageNotifications(); |
| 90 | void PrintNotifications(FILE* file); |
| 91 | |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 92 | private: |
Bjorn Terelius | c4ca1d3 | 2018-04-27 14:33:34 +0200 | [diff] [blame] | 93 | template <typename IterableType> |
| 94 | void CreateAccumulatedPacketsTimeSeries(Plot* plot, |
| 95 | const IterableType& packets, |
| 96 | const std::string& label); |
philipel | ccd7489 | 2016-09-05 02:46:25 -0700 | [diff] [blame] | 97 | |
Qingsi Wang | 8eca1ff | 2018-02-02 11:49:44 -0800 | [diff] [blame] | 98 | std::string GetCandidatePairLogDescriptionFromId(uint32_t candidate_pair_id); |
| 99 | |
Sebastian Jansson | b290a6d | 2019-01-03 14:46:23 +0100 | [diff] [blame] | 100 | const ParsedRtcEventLog& parsed_log_; |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 101 | |
| 102 | // A list of SSRCs we are interested in analysing. |
| 103 | // If left empty, all SSRCs will be considered relevant. |
| 104 | std::vector<uint32_t> desired_ssrc_; |
| 105 | |
Qingsi Wang | 8eca1ff | 2018-02-02 11:49:44 -0800 | [diff] [blame] | 106 | std::map<uint32_t, std::string> candidate_pair_desc_by_id_; |
| 107 | |
Bjorn Terelius | 068fc35 | 2019-02-13 22:38:25 +0100 | [diff] [blame] | 108 | AnalyzerConfig config_; |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 109 | }; |
| 110 | |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 111 | } // namespace webrtc |
| 112 | |
Mirko Bonadei | 575998c | 2019-07-25 13:57:41 +0200 | [diff] [blame] | 113 | #endif // RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_ANALYZER_H_ |