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 11 #ifndef RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_ANALYZER_H_ 12 #define RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_ANALYZER_H_ 13 14 #include <map> 15 #include <memory> 16 #include <set> 17 #include <string> 18 #include <utility> 19 #include <vector> 20 21 #include "logging/rtc_event_log/rtc_event_log_parser.h" 22 #include "modules/audio_coding/neteq/tools/neteq_stats_getter.h" 23 #include "rtc_base/strings/string_builder.h" 24 #include "rtc_tools/rtc_event_log_visualizer/analyzer_common.h" 25 #include "rtc_tools/rtc_event_log_visualizer/plot_base.h" 26 27 namespace webrtc { 28 29 class EventLogAnalyzer { 30 public: 31 // The EventLogAnalyzer keeps a reference to the ParsedRtcEventLogNew for the 32 // duration of its lifetime. The ParsedRtcEventLogNew must not be destroyed or 33 // modified while the EventLogAnalyzer is being used. 34 EventLogAnalyzer(const ParsedRtcEventLog& log, bool normalize_time); 35 EventLogAnalyzer(const ParsedRtcEventLog& log, const AnalyzerConfig& config); 36 37 void CreatePacketGraph(PacketDirection direction, Plot* plot); 38 39 void CreateRtcpTypeGraph(PacketDirection direction, Plot* plot); 40 41 void CreateAccumulatedPacketsGraph(PacketDirection direction, Plot* plot); 42 43 void CreatePacketRateGraph(PacketDirection direction, Plot* plot); 44 45 void CreateTotalPacketRateGraph(PacketDirection direction, Plot* plot); 46 47 void CreatePlayoutGraph(Plot* plot); 48 49 void CreateAudioLevelGraph(PacketDirection direction, Plot* plot); 50 51 void CreateSequenceNumberGraph(Plot* plot); 52 53 void CreateIncomingPacketLossGraph(Plot* plot); 54 55 void CreateIncomingDelayGraph(Plot* plot); 56 57 void CreateFractionLossGraph(Plot* plot); 58 59 void CreateTotalIncomingBitrateGraph(Plot* plot); 60 void CreateTotalOutgoingBitrateGraph(Plot* plot, 61 bool show_detector_state = false, 62 bool show_alr_state = false); 63 64 void CreateStreamBitrateGraph(PacketDirection direction, Plot* plot); 65 void CreateBitrateAllocationGraph(PacketDirection direction, Plot* plot); 66 67 void CreateGoogCcSimulationGraph(Plot* plot); 68 void CreateSendSideBweSimulationGraph(Plot* plot); 69 void CreateReceiveSideBweSimulationGraph(Plot* plot); 70 71 void CreateNetworkDelayFeedbackGraph(Plot* plot); 72 void CreatePacerDelayGraph(Plot* plot); 73 74 void CreateTimestampGraph(PacketDirection direction, Plot* plot); 75 void CreateSenderAndReceiverReportPlot( 76 PacketDirection direction, 77 rtc::FunctionView<float(const rtcp::ReportBlock&)> fy, 78 std::string title, 79 std::string yaxis_label, 80 Plot* plot); 81 82 void CreateIceCandidatePairConfigGraph(Plot* plot); 83 void CreateIceConnectivityCheckGraph(Plot* plot); 84 85 void CreateDtlsTransportStateGraph(Plot* plot); 86 void CreateDtlsWritableStateGraph(Plot* plot); 87 88 void CreateTriageNotifications(); 89 void PrintNotifications(FILE* file); 90 91 private: 92 template <typename IterableType> 93 void CreateAccumulatedPacketsTimeSeries(Plot* plot, 94 const IterableType& packets, 95 const std::string& label); 96 97 std::string GetCandidatePairLogDescriptionFromId(uint32_t candidate_pair_id); 98 99 const ParsedRtcEventLog& parsed_log_; 100 101 // A list of SSRCs we are interested in analysing. 102 // If left empty, all SSRCs will be considered relevant. 103 std::vector<uint32_t> desired_ssrc_; 104 105 std::map<uint32_t, std::string> candidate_pair_desc_by_id_; 106 107 AnalyzerConfig config_; 108 }; 109 110 } // namespace webrtc 111 112 #endif // RTC_TOOLS_RTC_EVENT_LOG_VISUALIZER_ANALYZER_H_ 113