2016-07-13 06:44:41 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-07-25 13:57:41 +02:00
|
|
|
#ifndef RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_ANALYZER_H_
|
|
|
|
|
#define RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_ANALYZER_H_
|
2016-07-13 06:44:41 -07:00
|
|
|
|
2023-10-30 11:33:21 +01:00
|
|
|
#include <cstdint>
|
|
|
|
|
#include <cstdio>
|
2016-07-19 01:51:06 -07:00
|
|
|
#include <map>
|
2016-09-05 02:46:25 -07:00
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
2016-07-13 06:44:41 -07:00
|
|
|
|
2023-10-30 11:33:21 +01:00
|
|
|
#include "api/function_view.h"
|
2019-01-03 14:46:23 +01:00
|
|
|
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
2023-10-30 11:33:21 +01:00
|
|
|
#include "modules/rtp_rtcp/source/rtcp_packet/report_block.h"
|
2020-05-19 10:57:24 +02:00
|
|
|
#include "rtc_tools/rtc_event_log_visualizer/analyzer_common.h"
|
2019-07-25 13:57:41 +02:00
|
|
|
#include "rtc_tools/rtc_event_log_visualizer/plot_base.h"
|
2016-07-13 06:44:41 -07:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
2017-02-22 07:33:27 -08:00
|
|
|
|
2016-07-13 06:44:41 -07:00
|
|
|
class EventLogAnalyzer {
|
2024-04-19 16:29:18 +02:00
|
|
|
struct PlotDeclaration {
|
|
|
|
|
PlotDeclaration(const std::string& label, std::function<void(Plot*)> f)
|
|
|
|
|
: label(label), plot_func(f) {}
|
|
|
|
|
const std::string label;
|
|
|
|
|
// TODO(terelius): Add a help text/explanation.
|
|
|
|
|
const std::function<void(Plot*)> plot_func;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class PlotMap {
|
|
|
|
|
public:
|
|
|
|
|
void RegisterPlot(const std::string& label, std::function<void(Plot*)> f) {
|
|
|
|
|
for (const auto& plot : plots_) {
|
|
|
|
|
RTC_DCHECK(plot.label != label)
|
|
|
|
|
<< "Can't use the same label for multiple plots";
|
|
|
|
|
}
|
|
|
|
|
plots_.push_back({label, f});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<PlotDeclaration>::iterator begin() { return plots_.begin(); }
|
|
|
|
|
std::vector<PlotDeclaration>::iterator end() { return plots_.end(); }
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::vector<PlotDeclaration> plots_;
|
|
|
|
|
};
|
|
|
|
|
|
2016-07-13 06:44:41 -07:00
|
|
|
public:
|
2018-04-27 14:33:34 +02:00
|
|
|
// The EventLogAnalyzer keeps a reference to the ParsedRtcEventLogNew for the
|
|
|
|
|
// duration of its lifetime. The ParsedRtcEventLogNew must not be destroyed or
|
2016-07-13 06:44:41 -07:00
|
|
|
// modified while the EventLogAnalyzer is being used.
|
2019-01-03 14:46:23 +01:00
|
|
|
EventLogAnalyzer(const ParsedRtcEventLog& log, bool normalize_time);
|
2020-05-19 10:57:24 +02:00
|
|
|
EventLogAnalyzer(const ParsedRtcEventLog& log, const AnalyzerConfig& config);
|
2016-07-13 06:44:41 -07:00
|
|
|
|
2024-04-19 16:29:18 +02:00
|
|
|
void CreateGraphsByName(const std::vector<std::string>& names,
|
|
|
|
|
PlotCollection* collection);
|
|
|
|
|
|
|
|
|
|
void InitializeMapOfNamedGraphs(bool show_detector_state,
|
|
|
|
|
bool show_alr_state,
|
|
|
|
|
bool show_link_capacity);
|
|
|
|
|
|
|
|
|
|
std::vector<std::string> GetGraphNames() {
|
|
|
|
|
std::vector<std::string> plot_names;
|
|
|
|
|
for (const auto& plot : plots_) {
|
|
|
|
|
plot_names.push_back(plot.label);
|
|
|
|
|
}
|
|
|
|
|
return plot_names;
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-27 14:33:34 +02:00
|
|
|
void CreatePacketGraph(PacketDirection direction, Plot* plot);
|
2016-07-13 06:44:41 -07:00
|
|
|
|
2019-02-15 17:20:12 +01:00
|
|
|
void CreateRtcpTypeGraph(PacketDirection direction, Plot* plot);
|
|
|
|
|
|
2018-04-27 14:33:34 +02:00
|
|
|
void CreateAccumulatedPacketsGraph(PacketDirection direction, Plot* plot);
|
2016-09-05 02:46:25 -07:00
|
|
|
|
2020-03-30 13:01:37 +02:00
|
|
|
void CreatePacketRateGraph(PacketDirection direction, Plot* plot);
|
|
|
|
|
|
2020-04-01 14:33:30 +02:00
|
|
|
void CreateTotalPacketRateGraph(PacketDirection direction, Plot* plot);
|
|
|
|
|
|
2016-07-13 06:44:41 -07:00
|
|
|
void CreatePlayoutGraph(Plot* plot);
|
|
|
|
|
|
2023-01-16 11:23:36 +01:00
|
|
|
void CreateNetEqSetMinimumDelay(Plot* plot);
|
|
|
|
|
|
2018-04-27 14:33:34 +02:00
|
|
|
void CreateAudioLevelGraph(PacketDirection direction, Plot* plot);
|
2016-09-22 07:01:47 -07:00
|
|
|
|
2016-07-13 06:44:41 -07:00
|
|
|
void CreateSequenceNumberGraph(Plot* plot);
|
|
|
|
|
|
2016-09-09 13:37:50 +02:00
|
|
|
void CreateIncomingPacketLossGraph(Plot* plot);
|
|
|
|
|
|
2017-08-15 02:04:02 -07:00
|
|
|
void CreateIncomingDelayGraph(Plot* plot);
|
2016-07-13 06:44:41 -07:00
|
|
|
|
2016-08-04 10:00:11 -07:00
|
|
|
void CreateFractionLossGraph(Plot* plot);
|
|
|
|
|
|
2018-04-27 14:33:34 +02:00
|
|
|
void CreateTotalIncomingBitrateGraph(Plot* plot);
|
|
|
|
|
void CreateTotalOutgoingBitrateGraph(Plot* plot,
|
|
|
|
|
bool show_detector_state = false,
|
2022-07-19 14:09:45 +02:00
|
|
|
bool show_alr_state = false,
|
|
|
|
|
bool show_link_capacity = false);
|
2016-07-13 06:44:41 -07:00
|
|
|
|
2018-04-27 14:33:34 +02:00
|
|
|
void CreateStreamBitrateGraph(PacketDirection direction, Plot* plot);
|
2019-02-15 17:29:58 +01:00
|
|
|
void CreateBitrateAllocationGraph(PacketDirection direction, Plot* plot);
|
2016-07-13 06:44:41 -07:00
|
|
|
|
2023-10-13 09:29:30 +00:00
|
|
|
void CreateOutgoingTWCCLossRateGraph(Plot* plot);
|
2019-03-13 08:56:58 +01:00
|
|
|
void CreateGoogCcSimulationGraph(Plot* plot);
|
2017-10-04 14:22:43 +02:00
|
|
|
void CreateSendSideBweSimulationGraph(Plot* plot);
|
|
|
|
|
void CreateReceiveSideBweSimulationGraph(Plot* plot);
|
2016-07-29 14:48:54 +02:00
|
|
|
|
2016-08-15 08:47:14 -07:00
|
|
|
void CreateNetworkDelayFeedbackGraph(Plot* plot);
|
2017-10-25 17:42:41 +02:00
|
|
|
void CreatePacerDelayGraph(Plot* plot);
|
2018-04-27 14:33:34 +02:00
|
|
|
|
|
|
|
|
void CreateTimestampGraph(PacketDirection direction, Plot* plot);
|
2018-07-24 13:45:31 +02:00
|
|
|
void CreateSenderAndReceiverReportPlot(
|
|
|
|
|
PacketDirection direction,
|
|
|
|
|
rtc::FunctionView<float(const rtcp::ReportBlock&)> fy,
|
|
|
|
|
std::string title,
|
|
|
|
|
std::string yaxis_label,
|
|
|
|
|
Plot* plot);
|
2016-08-02 07:22:17 -07:00
|
|
|
|
2018-02-02 11:49:44 -08:00
|
|
|
void CreateIceCandidatePairConfigGraph(Plot* plot);
|
|
|
|
|
void CreateIceConnectivityCheckGraph(Plot* plot);
|
|
|
|
|
|
2018-12-07 12:26:28 -08:00
|
|
|
void CreateDtlsTransportStateGraph(Plot* plot);
|
|
|
|
|
void CreateDtlsWritableStateGraph(Plot* plot);
|
|
|
|
|
|
2017-11-30 15:15:25 +01:00
|
|
|
void CreateTriageNotifications();
|
|
|
|
|
void PrintNotifications(FILE* file);
|
|
|
|
|
|
2016-07-13 06:44:41 -07:00
|
|
|
private:
|
2018-04-27 14:33:34 +02:00
|
|
|
template <typename IterableType>
|
|
|
|
|
void CreateAccumulatedPacketsTimeSeries(Plot* plot,
|
|
|
|
|
const IterableType& packets,
|
|
|
|
|
const std::string& label);
|
|
|
|
|
|
2018-02-02 11:49:44 -08:00
|
|
|
std::string GetCandidatePairLogDescriptionFromId(uint32_t candidate_pair_id);
|
|
|
|
|
|
2019-01-03 14:46:23 +01:00
|
|
|
const ParsedRtcEventLog& parsed_log_;
|
2016-07-13 06:44:41 -07:00
|
|
|
|
|
|
|
|
// A list of SSRCs we are interested in analysing.
|
|
|
|
|
// If left empty, all SSRCs will be considered relevant.
|
|
|
|
|
std::vector<uint32_t> desired_ssrc_;
|
|
|
|
|
|
2018-02-02 11:49:44 -08:00
|
|
|
std::map<uint32_t, std::string> candidate_pair_desc_by_id_;
|
|
|
|
|
|
2019-02-13 22:38:25 +01:00
|
|
|
AnalyzerConfig config_;
|
2024-04-19 16:29:18 +02:00
|
|
|
|
|
|
|
|
PlotMap plots_;
|
2016-07-13 06:44:41 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2019-07-25 13:57:41 +02:00
|
|
|
#endif // RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_ANALYZER_H_
|