blob: e58a4823f738fa2db7e094a5c4a7ee6915596502 [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
Lionel Koenig6afa92a2023-01-16 11:23:36 +010049 void CreateNetEqSetMinimumDelay(Plot* plot);
50
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020051 void CreateAudioLevelGraph(PacketDirection direction, Plot* plot);
ivocaac9d6f2016-09-22 07:01:47 -070052
terelius54ce6802016-07-13 06:44:41 -070053 void CreateSequenceNumberGraph(Plot* plot);
54
Stefan Holmer99f8e082016-09-09 13:37:50 +020055 void CreateIncomingPacketLossGraph(Plot* plot);
56
terelius2ee076d2017-08-15 02:04:02 -070057 void CreateIncomingDelayGraph(Plot* plot);
terelius54ce6802016-07-13 06:44:41 -070058
tereliusf736d232016-08-04 10:00:11 -070059 void CreateFractionLossGraph(Plot* plot);
60
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020061 void CreateTotalIncomingBitrateGraph(Plot* plot);
62 void CreateTotalOutgoingBitrateGraph(Plot* plot,
63 bool show_detector_state = false,
Diep Bui38b3cf02022-07-19 14:09:45 +020064 bool show_alr_state = false,
65 bool show_link_capacity = false);
terelius54ce6802016-07-13 06:44:41 -070066
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020067 void CreateStreamBitrateGraph(PacketDirection direction, Plot* plot);
Bjorn Terelius9775a582019-02-15 17:29:58 +010068 void CreateBitrateAllocationGraph(PacketDirection direction, Plot* plot);
terelius54ce6802016-07-13 06:44:41 -070069
Sebastian Jansson1175ae02019-03-13 08:56:58 +010070 void CreateGoogCcSimulationGraph(Plot* plot);
Bjorn Terelius28db2662017-10-04 14:22:43 +020071 void CreateSendSideBweSimulationGraph(Plot* plot);
72 void CreateReceiveSideBweSimulationGraph(Plot* plot);
Stefan Holmer13181032016-07-29 14:48:54 +020073
tereliuse34c19c2016-08-15 08:47:14 -070074 void CreateNetworkDelayFeedbackGraph(Plot* plot);
Bjorn Terelius0295a962017-10-25 17:42:41 +020075 void CreatePacerDelayGraph(Plot* plot);
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020076
77 void CreateTimestampGraph(PacketDirection direction, Plot* plot);
Bjorn Tereliusb1222c22018-07-24 13:45:31 +020078 void CreateSenderAndReceiverReportPlot(
79 PacketDirection direction,
80 rtc::FunctionView<float(const rtcp::ReportBlock&)> fy,
81 std::string title,
82 std::string yaxis_label,
83 Plot* plot);
stefanc3de0332016-08-02 07:22:17 -070084
Qingsi Wang8eca1ff2018-02-02 11:49:44 -080085 void CreateIceCandidatePairConfigGraph(Plot* plot);
86 void CreateIceConnectivityCheckGraph(Plot* plot);
87
Zach Stein10a58012018-12-07 12:26:28 -080088 void CreateDtlsTransportStateGraph(Plot* plot);
89 void CreateDtlsWritableStateGraph(Plot* plot);
90
Bjorn Terelius2eb31882017-11-30 15:15:25 +010091 void CreateTriageNotifications();
92 void PrintNotifications(FILE* file);
93
terelius54ce6802016-07-13 06:44:41 -070094 private:
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +020095 template <typename IterableType>
96 void CreateAccumulatedPacketsTimeSeries(Plot* plot,
97 const IterableType& packets,
98 const std::string& label);
philipelccd74892016-09-05 02:46:25 -070099
Qingsi Wang8eca1ff2018-02-02 11:49:44 -0800100 std::string GetCandidatePairLogDescriptionFromId(uint32_t candidate_pair_id);
101
Sebastian Janssonb290a6d2019-01-03 14:46:23 +0100102 const ParsedRtcEventLog& parsed_log_;
terelius54ce6802016-07-13 06:44:41 -0700103
104 // A list of SSRCs we are interested in analysing.
105 // If left empty, all SSRCs will be considered relevant.
106 std::vector<uint32_t> desired_ssrc_;
107
Qingsi Wang8eca1ff2018-02-02 11:49:44 -0800108 std::map<uint32_t, std::string> candidate_pair_desc_by_id_;
109
Bjorn Terelius068fc352019-02-13 22:38:25 +0100110 AnalyzerConfig config_;
terelius54ce6802016-07-13 06:44:41 -0700111};
112
terelius54ce6802016-07-13 06:44:41 -0700113} // namespace webrtc
114
Mirko Bonadei575998c2019-07-25 13:57:41 +0200115#endif // RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_ANALYZER_H_