From 10a58016ee1ffd82d80daee115424668b5f2da77 Mon Sep 17 00:00:00 2001 From: Zach Stein Date: Fri, 7 Dec 2018 12:26:28 -0800 Subject: [PATCH] Output plots for new DTLS events. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:10101 Change-Id: Ida8084549bc386b91fec468026c3f4a261a4ef50 Reviewed-on: https://webrtc-review.googlesource.com/c/113462 Commit-Queue: Zach Stein Reviewed-by: Björn Terelius Cr-Commit-Position: refs/heads/master@{#25941} --- rtc_tools/event_log_visualizer/analyzer.cc | 31 ++++++++++++++++++++++ rtc_tools/event_log_visualizer/analyzer.h | 3 +++ rtc_tools/event_log_visualizer/main.cc | 13 +++++++++ 3 files changed, 47 insertions(+) diff --git a/rtc_tools/event_log_visualizer/analyzer.cc b/rtc_tools/event_log_visualizer/analyzer.cc index 567276c829..89f239171f 100644 --- a/rtc_tools/event_log_visualizer/analyzer.cc +++ b/rtc_tools/event_log_visualizer/analyzer.cc @@ -1979,6 +1979,37 @@ void EventLogAnalyzer::CreateIceConnectivityCheckGraph(Plot* plot) { plot->SetTitle("[IceEventLog] ICE connectivity checks"); } +void EventLogAnalyzer::CreateDtlsTransportStateGraph(Plot* plot) { + TimeSeries states("DTLS Transport State", LineStyle::kNone, + PointStyle::kHighlight); + for (const auto& event : parsed_log_.dtls_transport_states()) { + float x = ToCallTimeSec(event.log_time_us()); + float y = static_cast(event.dtls_transport_state); + states.points.emplace_back(x, y); + } + plot->AppendTimeSeries(std::move(states)); + plot->SetXAxis(ToCallTimeSec(begin_time_), call_duration_s_, "Time (s)", + kLeftMargin, kRightMargin); + plot->SetSuggestedYAxis(0, static_cast(DtlsTransportState::kNumValues), + "Numeric Transport State", kBottomMargin, kTopMargin); + plot->SetTitle("DTLS Transport State"); +} + +void EventLogAnalyzer::CreateDtlsWritableStateGraph(Plot* plot) { + TimeSeries writable("DTLS Writable", LineStyle::kNone, + PointStyle::kHighlight); + for (const auto& event : parsed_log_.dtls_writable_states()) { + float x = ToCallTimeSec(event.log_time_us()); + float y = static_cast(event.writable); + writable.points.emplace_back(x, y); + } + plot->AppendTimeSeries(std::move(writable)); + plot->SetXAxis(ToCallTimeSec(begin_time_), call_duration_s_, "Time (s)", + kLeftMargin, kRightMargin); + plot->SetSuggestedYAxis(0, 1, "Writable", kBottomMargin, kTopMargin); + plot->SetTitle("DTLS Writable State"); +} + void EventLogAnalyzer::PrintNotifications(FILE* file) { fprintf(file, "========== TRIAGE NOTIFICATIONS ==========\n"); for (const auto& alert : incoming_rtp_recv_time_gaps_) { diff --git a/rtc_tools/event_log_visualizer/analyzer.h b/rtc_tools/event_log_visualizer/analyzer.h index c6606c2b1f..35a44b903f 100644 --- a/rtc_tools/event_log_visualizer/analyzer.h +++ b/rtc_tools/event_log_visualizer/analyzer.h @@ -99,6 +99,9 @@ class EventLogAnalyzer { void CreateIceCandidatePairConfigGraph(Plot* plot); void CreateIceConnectivityCheckGraph(Plot* plot); + void CreateDtlsTransportStateGraph(Plot* plot); + void CreateDtlsWritableStateGraph(Plot* plot); + void CreateTriageNotifications(); void PrintNotifications(FILE* file); diff --git a/rtc_tools/event_log_visualizer/main.cc b/rtc_tools/event_log_visualizer/main.cc index e3f4d504db..4808f9dad0 100644 --- a/rtc_tools/event_log_visualizer/main.cc +++ b/rtc_tools/event_log_visualizer/main.cc @@ -151,6 +151,12 @@ WEBRTC_DEFINE_bool(plot_ice_candidate_pair_config, WEBRTC_DEFINE_bool(plot_ice_connectivity_check, false, "Plot the ICE candidate pair connectivity checks."); +WEBRTC_DEFINE_bool(plot_dtls_transport_state, + false, + "Plot DTLS transport state changes."); +WEBRTC_DEFINE_bool(plot_dtls_writable_state, + false, + "Plot DTLS writable state changes."); WEBRTC_DEFINE_string( force_fieldtrials, @@ -469,6 +475,13 @@ int main(int argc, char* argv[]) { analyzer.CreateIceConnectivityCheckGraph(collection->AppendNewPlot()); } + if (FLAG_plot_dtls_transport_state) { + analyzer.CreateDtlsTransportStateGraph(collection->AppendNewPlot()); + } + if (FLAG_plot_dtls_writable_state) { + analyzer.CreateDtlsWritableStateGraph(collection->AppendNewPlot()); + } + collection->Draw(); if (FLAG_print_triage_alerts) {