From 7e2f6b7d92696a420ae6b541325714c989fefd1e Mon Sep 17 00:00:00 2001 From: Artem Titov Date: Tue, 23 Apr 2019 16:33:38 +0200 Subject: [PATCH] Fix reporting of metrics when there is no video in the test. Before if there is no video in PC quality test video quaity analyzer failed on RTC_CHECK becuase of empty counter. Now it will report no metrics and print 0 in debug logging. Bug: webrtc:10138 Change-Id: If6656a613465c522cac1d4b2e4dd455e409229ba Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133886 Reviewed-by: Artem Titarenko Commit-Queue: Artem Titov Cr-Commit-Position: refs/heads/master@{#27731} --- .../analyzer/video/default_video_quality_analyzer.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/pc/e2e/analyzer/video/default_video_quality_analyzer.cc b/test/pc/e2e/analyzer/video/default_video_quality_analyzer.cc index 7ad7b547e4..dff5155dd6 100644 --- a/test/pc/e2e/analyzer/video/default_video_quality_analyzer.cc +++ b/test/pc/e2e/analyzer/video/default_video_quality_analyzer.cc @@ -492,11 +492,13 @@ void DefaultVideoQualityAnalyzer::ReportResults() { LogFrameCounters(item.first, stream_frame_counters_.at(item.first)); LogStreamInternalStats(item.first, item.second); } - RTC_LOG(INFO) << "comparisons_queue_size min=" - << analyzer_stats_.comparisons_queue_size.GetMin() - << "; max=" << analyzer_stats_.comparisons_queue_size.GetMax() - << "; 99%=" - << analyzer_stats_.comparisons_queue_size.GetPercentile(0.99); + if (!analyzer_stats_.comparisons_queue_size.IsEmpty()) { + RTC_LOG(INFO) << "comparisons_queue_size min=" + << analyzer_stats_.comparisons_queue_size.GetMin() + << "; max=" << analyzer_stats_.comparisons_queue_size.GetMax() + << "; 99%=" + << analyzer_stats_.comparisons_queue_size.GetPercentile(0.99); + } RTC_LOG(INFO) << "comparisons_done=" << analyzer_stats_.comparisons_done; RTC_LOG(INFO) << "overloaded_comparisons_done=" << analyzer_stats_.overloaded_comparisons_done;