analyzer.h 3.8 KB

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