Adds more stats to CallStatsCollector.

Also adding checks to avoid adding empty stats.

Bug: webrtc:10365
Change-Id: I37ab32a3d4271fcad419f17841a8d2e524d73245
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133020
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27625}
This commit is contained in:
Sebastian Jansson
2019-04-15 15:10:18 +02:00
committed by Commit Bot
parent df88cc014a
commit 72b7524d87
2 changed files with 8 additions and 1 deletions

View File

@ -134,6 +134,8 @@ struct VideoQualityStats {
struct CollectedCallStats {
SampleStats<DataRate> target_rate;
SampleStats<TimeDelta> pacer_delay;
SampleStats<TimeDelta> round_trip_time;
SampleStats<double> memory_usage;
};

View File

@ -112,7 +112,12 @@ void VideoLayerAnalyzer::HandleRenderedFrame(const VideoFramePair& sample) {
}
void CallStatsCollector::AddStats(Call::Stats sample) {
stats_.target_rate.AddSampleBps(sample.send_bandwidth_bps);
if (sample.send_bandwidth_bps > 0)
stats_.target_rate.AddSampleBps(sample.send_bandwidth_bps);
if (sample.pacer_delay_ms > 0)
stats_.pacer_delay.AddSample(TimeDelta::ms(sample.pacer_delay_ms));
if (sample.rtt_ms > 0)
stats_.round_trip_time.AddSample(TimeDelta::ms(sample.rtt_ms));
stats_.memory_usage.AddSample(rtc::GetProcessResidentSizeBytes());
}