Index: webrtc/video/send_statistics_proxy.cc |
diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc |
index 83399a9013df898de83f90347b4d1e11c1b0514a..2da6cdce0ef1a0687fd64054d35aff7f7c77f75e 100644 |
--- a/webrtc/video/send_statistics_proxy.cc |
+++ b/webrtc/video/send_statistics_proxy.cc |
@@ -86,7 +86,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(); |
@@ -156,6 +157,16 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms() { |
RTC_HISTOGRAM_COUNTS_SPARSE_100000(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_HISTOGRAM_PERCENTAGE("WebRTC.Video.SentPacketsLostInPercent", |
+ fraction_lost); |
+ } |
+ } |
} |
void SendStatisticsProxy::SetContentType( |
@@ -347,6 +358,9 @@ void SendStatisticsProxy::StatisticsUpdated(const RtcpStatistics& statistics, |
return; |
stats->rtcp_stats = statistics; |
+ uma_container_->report_block_stats_.Store(statistics, ssrc, 0); |
åsapersson
2016/02/05 13:50:12
Should this be Store(statistics, 0, ssrc)?
sprang
2016/02/05 14:10:22
Done.
|
+ 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) { |