Add delay metric (includes network delay (rtt/2) + jitter delay + decode time + render delay):

- "WebRTC.Video.OnewayDelayInMs"

BUG=chromium:512752

Review URL: https://codereview.webrtc.org/1351403008

Cr-Commit-Position: refs/heads/master@{#10180}
This commit is contained in:
asapersson 2015-10-06 04:08:15 -07:00 committed by Commit bot
parent 7bd242e53d
commit 13c433c299
4 changed files with 16 additions and 3 deletions

View File

@ -53,6 +53,10 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples);
if (decode_ms != -1)
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms);
int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples);
if (delay_ms != -1)
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms);
}
VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const {
@ -78,7 +82,8 @@ void ReceiveStatisticsProxy::OnDecoderTiming(int decode_ms,
int target_delay_ms,
int jitter_buffer_ms,
int min_playout_delay_ms,
int render_delay_ms) {
int render_delay_ms,
int64_t rtt_ms) {
rtc::CritScope lock(&crit_);
stats_.decode_ms = decode_ms;
stats_.max_decode_ms = max_decode_ms;
@ -88,6 +93,9 @@ void ReceiveStatisticsProxy::OnDecoderTiming(int decode_ms,
stats_.min_playout_delay_ms = min_playout_delay_ms;
stats_.render_delay_ms = render_delay_ms;
decode_time_counter_.Add(decode_ms);
// Network delay (rtt/2) + target_delay_ms (jitter delay + decode time +
// render delay).
delay_counter_.Add(target_delay_ms + rtt_ms / 2);
}
void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated(

View File

@ -51,7 +51,8 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
int target_delay_ms,
int jitter_buffer_ms,
int min_playout_delay_ms,
int render_delay_ms);
int render_delay_ms,
int64_t rtt_ms);
// Overrides VCMReceiveStatisticsCallback.
void OnReceiveRatesUpdated(uint32_t bitRate, uint32_t frameRate) override;
@ -94,6 +95,7 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
SampleCounter render_width_counter_ GUARDED_BY(crit_);
SampleCounter render_height_counter_ GUARDED_BY(crit_);
SampleCounter decode_time_counter_ GUARDED_BY(crit_);
SampleCounter delay_counter_ GUARDED_BY(crit_);
ReportBlockStats report_block_stats_ GUARDED_BY(crit_);
};

View File

@ -115,6 +115,7 @@ ViEChannel::ViEChannel(uint32_t number_of_cores,
report_block_stats_sender_(new ReportBlockStats()),
time_of_first_rtt_ms_(-1),
rtt_sum_ms_(0),
last_rtt_ms_(0),
num_rtts_(0),
rtp_rtcp_modules_(
CreateRtpRtcpModules(!sender,
@ -1068,7 +1069,7 @@ void ViEChannel::OnDecoderTiming(int decode_ms,
return;
receive_stats_callback_->OnDecoderTiming(
decode_ms, max_decode_ms, current_delay_ms, target_delay_ms,
jitter_buffer_ms, min_playout_delay_ms, render_delay_ms);
jitter_buffer_ms, min_playout_delay_ms, render_delay_ms, last_rtt_ms_);
}
int32_t ViEChannel::RequestKeyFrame() {
@ -1102,6 +1103,7 @@ void ViEChannel::OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) {
if (time_of_first_rtt_ms_ == -1)
time_of_first_rtt_ms_ = Clock::GetRealTimeClock()->TimeInMilliseconds();
rtt_sum_ms_ += avg_rtt_ms;
last_rtt_ms_ = avg_rtt_ms;
++num_rtts_;
}

View File

@ -443,6 +443,7 @@ class ViEChannel : public VCMFrameTypeCallback,
int64_t time_of_first_rtt_ms_ GUARDED_BY(crit_);
int64_t rtt_sum_ms_ GUARDED_BY(crit_);
int64_t last_rtt_ms_ GUARDED_BY(crit_);
size_t num_rtts_ GUARDED_BY(crit_);
// RtpRtcp modules, declared last as they use other members on construction.