blob: 1f31d8be1db0707324727517df3619ab2ac50cf7 [file] [log] [blame]
terelius54ce6802016-07-13 06:44:41 -07001/*
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 Bonadei575998c2019-07-25 13:57:41 +020011#ifndef RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_ANALYZER_H_
12#define RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_ANALYZER_H_
terelius54ce6802016-07-13 06:44:41 -070013
terelius88e64e52016-07-19 01:51:06 -070014#include <map>
Stefan Holmer13181032016-07-29 14:48:54 +020015#include <memory>
terelius0740a202016-08-08 10:21:04 -070016#include <set>
philipelccd74892016-09-05 02:46:25 -070017#include <string>
Stefan Holmer13181032016-07-29 14:48:54 +020018#include <utility>
philipelccd74892016-09-05 02:46:25 -070019#include <vector>
terelius54ce6802016-07-13 06:44:41 -070020
Sebastian Janssonb290a6d2019-01-03 14:46:23 +010021#include "logging/rtc_event_log/rtc_event_log_parser.h"
Minyue Lic6ff7572018-05-04 09:46:44 +020022#include "modules/audio_coding/neteq/tools/neteq_stats_getter.h"
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020023#include "rtc_base/strings/string_builder.h"
Bjorn Terelius48b82792020-05-19 10:57:24 +020024#include "rtc_tools/rtc_event_log_visualizer/analyzer_common.h"
Mirko Bonadei575998c2019-07-25 13:57:41 +020025#include "rtc_tools/rtc_event_log_visualizer/plot_base.h"
terelius54ce6802016-07-13 06:44:41 -070026
27namespace webrtc {
michaelt6e5b2192017-02-22 07:33:27 -080028
terelius54ce6802016-07-13 06:44:41 -070029class EventLogAnalyzer {
30 public:
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020031 // The EventLogAnalyzer keeps a reference to the ParsedRtcEventLogNew for the
32 // duration of its lifetime. The ParsedRtcEventLogNew must not be destroyed or
terelius54ce6802016-07-13 06:44:41 -070033 // modified while the EventLogAnalyzer is being used.
Sebastian Janssonb290a6d2019-01-03 14:46:23 +010034 EventLogAnalyzer(const ParsedRtcEventLog& log, bool normalize_time);
Bjorn Terelius48b82792020-05-19 10:57:24 +020035 EventLogAnalyzer(const ParsedRtcEventLog& log, const AnalyzerConfig& config);
terelius54ce6802016-07-13 06:44:41 -070036
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020037 void CreatePacketGraph(PacketDirection direction, Plot* plot);
terelius54ce6802016-07-13 06:44:41 -070038
Bjorn Terelius7c974e62019-02-15 17:20:12 +010039 void CreateRtcpTypeGraph(PacketDirection direction, Plot* plot);
40
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020041 void CreateAccumulatedPacketsGraph(PacketDirection direction, Plot* plot);
philipelccd74892016-09-05 02:46:25 -070042
Kristoffer Erlandsson283c1062020-03-30 13:01:37 +020043 void CreatePacketRateGraph(PacketDirection direction, Plot* plot);
44
Kristoffer Erlandssona2ce4232020-04-01 14:33:30 +020045 void CreateTotalPacketRateGraph(PacketDirection direction, Plot* plot);
46
terelius54ce6802016-07-13 06:44:41 -070047 void CreatePlayoutGraph(Plot* plot);
48
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020049 void CreateAudioLevelGraph(PacketDirection direction, Plot* plot);
ivocaac9d6f2016-09-22 07:01:47 -070050
terelius54ce6802016-07-13 06:44:41 -070051 void CreateSequenceNumberGraph(Plot* plot);
52
Stefan Holmer99f8e082016-09-09 13:37:50 +020053 void CreateIncomingPacketLossGraph(Plot* plot);
54
terelius2ee076d2017-08-15 02:04:02 -070055 void CreateIncomingDelayGraph(Plot* plot);
terelius54ce6802016-07-13 06:44:41 -070056
tereliusf736d232016-08-04 10:00:11 -070057 void CreateFractionLossGraph(Plot* plot);
58
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020059 void CreateTotalIncomingBitrateGraph(Plot* plot);
60 void CreateTotalOutgoingBitrateGraph(Plot* plot,
61 bool show_detector_state = false,
Diep Bui38b3cf02022-07-19 14:09:45 +020062 bool show_alr_state = false,
63 bool show_link_capacity = false);
terelius54ce6802016-07-13 06:44:41 -070064
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020065 void CreateStreamBitrateGraph(PacketDirection direction, Plot* plot);
Bjorn Terelius9775a582019-02-15 17:29:58 +010066 void CreateBitrateAllocationGraph(PacketDirection direction, Plot* plot);
terelius54ce6802016-07-13 06:44:41 -070067
Sebastian Jansson1175ae02019-03-13 08:56:58 +010068 void CreateGoogCcSimulationGraph(Plot* plot);
Bjorn Terelius28db2662017-10-04 14:22:43 +020069 void CreateSendSideBweSimulationGraph(Plot* plot);
70 void CreateReceiveSideBweSimulationGraph(Plot* plot);
Stefan Holmer13181032016-07-29 14:48:54 +020071
tereliuse34c19c2016-08-15 08:47:14 -070072 void CreateNetworkDelayFeedbackGraph(Plot* plot);
Bjorn Terelius0295a962017-10-25 17:42:41 +020073 void CreatePacerDelayGraph(Plot* plot);
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020074
75 void CreateTimestampGraph(PacketDirection direction, Plot* plot);
Bjorn Tereliusb1222c22018-07-24 13:45:31 +020076 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);
stefanc3de0332016-08-02 07:22:17 -070082
Qingsi Wang8eca1ff2018-02-02 11:49:44 -080083 void CreateIceCandidatePairConfigGraph(Plot* plot);
84 void CreateIceConnectivityCheckGraph(Plot* plot);
85
Zach Stein10a58012018-12-07 12:26:28 -080086 void CreateDtlsTransportStateGraph(Plot* plot);
87 void CreateDtlsWritableStateGraph(Plot* plot);
88
Bjorn Terelius2eb31882017-11-30 15:15:25 +010089 void CreateTriageNotifications();
90 void PrintNotifications(FILE* file);
91
terelius54ce6802016-07-13 06:44:41 -070092 private:
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020093 template <typename IterableType>
94 void CreateAccumulatedPacketsTimeSeries(Plot* plot,
95 const IterableType& packets,
96 const std::string& label);
philipelccd74892016-09-05 02:46:25 -070097
Qingsi Wang8eca1ff2018-02-02 11:49:44 -080098 std::string GetCandidatePairLogDescriptionFromId(uint32_t candidate_pair_id);
99
Sebastian Janssonb290a6d2019-01-03 14:46:23 +0100100 const ParsedRtcEventLog& parsed_log_;
terelius54ce6802016-07-13 06:44:41 -0700101
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 Wang8eca1ff2018-02-02 11:49:44 -0800106 std::map<uint32_t, std::string> candidate_pair_desc_by_id_;
107
Bjorn Terelius068fc352019-02-13 22:38:25 +0100108 AnalyzerConfig config_;
terelius54ce6802016-07-13 06:44:41 -0700109};
110
terelius54ce6802016-07-13 06:44:41 -0700111} // namespace webrtc
112
Mirko Bonadei575998c2019-07-25 13:57:41 +0200113#endif // RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_ANALYZER_H_