Index: webrtc/video/send_statistics_proxy.cc |
diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc |
index 8102b9310e371f3a419994a0e5324377c2ff4d39..a3bd1850e607311c9a1779b628075b33518b9ae6 100644 |
--- a/webrtc/video/send_statistics_proxy.cc |
+++ b/webrtc/video/send_statistics_proxy.cc |
@@ -89,7 +89,8 @@ SendStatisticsProxy::UmaSamplesContainer::UmaSamplesContainer( |
max_sent_width_per_timestamp_(0), |
max_sent_height_per_timestamp_(0), |
input_frame_rate_tracker_(100u, 10u), |
- sent_frame_rate_tracker_(100u, 10u) {} |
+ sent_frame_rate_tracker_(100u, 10u), |
+ first_rtcp_stats_time_ms_(-1) {} |
SendStatisticsProxy::UmaSamplesContainer::~UmaSamplesContainer() { |
UpdateHistograms(); |
@@ -166,6 +167,16 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms() { |
RTC_HISTOGRAMS_COUNTS_100000(kIndex, uma_prefix_ + "SendSideDelayMaxInMs", |
max_delay_ms); |
} |
+ int fraction_lost = report_block_stats_.FractionLostInPercent(); |
+ if (first_rtcp_stats_time_ms_ != -1) { |
+ int64_t elapsed_time_ms = Clock::GetRealTimeClock()->TimeInMilliseconds() - |
+ first_rtcp_stats_time_ms_; |
+ if (elapsed_time_ms / 1000 >= metrics::kMinRunTimeInSeconds && |
+ fraction_lost != -1) { |
+ RTC_HISTOGRAMS_PERCENTAGE( |
+ kIndex, uma_prefix_ + "SentPacketsLostInPercent", fraction_lost); |
+ } |
+ } |
} |
void SendStatisticsProxy::SetContentType( |
@@ -354,6 +365,9 @@ void SendStatisticsProxy::StatisticsUpdated(const RtcpStatistics& statistics, |
return; |
stats->rtcp_stats = statistics; |
+ uma_container_->report_block_stats_.Store(statistics, 0, ssrc); |
+ if (uma_container_->first_rtcp_stats_time_ms_ == -1) |
+ uma_container_->first_rtcp_stats_time_ms_ = clock_->TimeInMilliseconds(); |
} |
void SendStatisticsProxy::CNameChanged(const char* cname, uint32_t ssrc) { |