Only log once per UpdateHistogram call.
Since there's some overhead to each log statement we'll build the entire log message before logging it. Bug: webrtc:8529 Change-Id: I04876c7309afdd75985aa84726f8177e5a44bdb5 Reviewed-on: https://webrtc-review.googlesource.com/54301 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22097}
This commit is contained in:
@ -126,13 +126,14 @@ ReceiveStatisticsProxy::~ReceiveStatisticsProxy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ReceiveStatisticsProxy::UpdateHistograms() {
|
void ReceiveStatisticsProxy::UpdateHistograms() {
|
||||||
|
std::ostringstream logStream;
|
||||||
int stream_duration_sec = (clock_->TimeInMilliseconds() - start_ms_) / 1000;
|
int stream_duration_sec = (clock_->TimeInMilliseconds() - start_ms_) / 1000;
|
||||||
if (stats_.frame_counts.key_frames > 0 ||
|
if (stats_.frame_counts.key_frames > 0 ||
|
||||||
stats_.frame_counts.delta_frames > 0) {
|
stats_.frame_counts.delta_frames > 0) {
|
||||||
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.ReceiveStreamLifetimeInSeconds",
|
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.ReceiveStreamLifetimeInSeconds",
|
||||||
stream_duration_sec);
|
stream_duration_sec);
|
||||||
RTC_LOG(LS_INFO) << "WebRTC.Video.ReceiveStreamLifetimeInSeconds "
|
logStream << "WebRTC.Video.ReceiveStreamLifetimeInSeconds "
|
||||||
<< stream_duration_sec;
|
<< stream_duration_sec << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (first_report_block_time_ms_ != -1 &&
|
if (first_report_block_time_ms_ != -1 &&
|
||||||
@ -142,8 +143,8 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
|
|||||||
if (fraction_lost != -1) {
|
if (fraction_lost != -1) {
|
||||||
RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent",
|
RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent",
|
||||||
fraction_lost);
|
fraction_lost);
|
||||||
RTC_LOG(LS_INFO) << "WebRTC.Video.ReceivedPacketsLostInPercent "
|
logStream << "WebRTC.Video.ReceivedPacketsLostInPercent "
|
||||||
<< fraction_lost;
|
<< fraction_lost << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,14 +173,14 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
|
|||||||
int sync_offset_ms = sync_offset_counter_.Avg(kMinRequiredSamples);
|
int sync_offset_ms = sync_offset_counter_.Avg(kMinRequiredSamples);
|
||||||
if (sync_offset_ms != -1) {
|
if (sync_offset_ms != -1) {
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.AVSyncOffsetInMs", sync_offset_ms);
|
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.AVSyncOffsetInMs", sync_offset_ms);
|
||||||
RTC_LOG(LS_INFO) << "WebRTC.Video.AVSyncOffsetInMs " << sync_offset_ms;
|
logStream << "WebRTC.Video.AVSyncOffsetInMs " << sync_offset_ms << "\n";
|
||||||
}
|
}
|
||||||
AggregatedStats freq_offset_stats = freq_offset_counter_.GetStats();
|
AggregatedStats freq_offset_stats = freq_offset_counter_.GetStats();
|
||||||
if (freq_offset_stats.num_samples > 0) {
|
if (freq_offset_stats.num_samples > 0) {
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.RtpToNtpFreqOffsetInKhz",
|
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.RtpToNtpFreqOffsetInKhz",
|
||||||
freq_offset_stats.average);
|
freq_offset_stats.average);
|
||||||
RTC_LOG(LS_INFO) << "WebRTC.Video.RtpToNtpFreqOffsetInKhz, "
|
logStream << "WebRTC.Video.RtpToNtpFreqOffsetInKhz "
|
||||||
<< freq_offset_stats.ToString();
|
<< freq_offset_stats.ToString() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int num_total_frames =
|
int num_total_frames =
|
||||||
@ -190,37 +191,37 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
|
|||||||
(num_key_frames * 1000 + num_total_frames / 2) / num_total_frames;
|
(num_key_frames * 1000 + num_total_frames / 2) / num_total_frames;
|
||||||
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesReceivedInPermille",
|
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesReceivedInPermille",
|
||||||
key_frames_permille);
|
key_frames_permille);
|
||||||
RTC_LOG(LS_INFO) << "WebRTC.Video.KeyFramesReceivedInPermille "
|
logStream << "WebRTC.Video.KeyFramesReceivedInPermille "
|
||||||
<< key_frames_permille;
|
<< key_frames_permille << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int qp = qp_counters_.vp8.Avg(kMinRequiredSamples);
|
int qp = qp_counters_.vp8.Avg(kMinRequiredSamples);
|
||||||
if (qp != -1) {
|
if (qp != -1) {
|
||||||
RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp);
|
RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp);
|
||||||
RTC_LOG(LS_INFO) << "WebRTC.Video.Decoded.Vp8.Qp " << qp;
|
logStream << "WebRTC.Video.Decoded.Vp8.Qp " << qp << "\n";
|
||||||
}
|
}
|
||||||
int decode_ms = decode_time_counter_.Avg(kMinRequiredSamples);
|
int decode_ms = decode_time_counter_.Avg(kMinRequiredSamples);
|
||||||
if (decode_ms != -1) {
|
if (decode_ms != -1) {
|
||||||
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms);
|
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms);
|
||||||
RTC_LOG(LS_INFO) << "WebRTC.Video.DecodeTimeInMs " << decode_ms;
|
logStream << "WebRTC.Video.DecodeTimeInMs " << decode_ms << "\n";
|
||||||
}
|
}
|
||||||
int jb_delay_ms = jitter_buffer_delay_counter_.Avg(kMinRequiredSamples);
|
int jb_delay_ms = jitter_buffer_delay_counter_.Avg(kMinRequiredSamples);
|
||||||
if (jb_delay_ms != -1) {
|
if (jb_delay_ms != -1) {
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.JitterBufferDelayInMs",
|
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.JitterBufferDelayInMs",
|
||||||
jb_delay_ms);
|
jb_delay_ms);
|
||||||
RTC_LOG(LS_INFO) << "WebRTC.Video.JitterBufferDelayInMs " << jb_delay_ms;
|
logStream << "WebRTC.Video.JitterBufferDelayInMs " << jb_delay_ms << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int target_delay_ms = target_delay_counter_.Avg(kMinRequiredSamples);
|
int target_delay_ms = target_delay_counter_.Avg(kMinRequiredSamples);
|
||||||
if (target_delay_ms != -1) {
|
if (target_delay_ms != -1) {
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.TargetDelayInMs", target_delay_ms);
|
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.TargetDelayInMs", target_delay_ms);
|
||||||
RTC_LOG(LS_INFO) << "WebRTC.Video.TargetDelayInMs " << target_delay_ms;
|
logStream << "WebRTC.Video.TargetDelayInMs " << target_delay_ms << "\n";
|
||||||
}
|
}
|
||||||
int current_delay_ms = current_delay_counter_.Avg(kMinRequiredSamples);
|
int current_delay_ms = current_delay_counter_.Avg(kMinRequiredSamples);
|
||||||
if (current_delay_ms != -1) {
|
if (current_delay_ms != -1) {
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.CurrentDelayInMs",
|
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.CurrentDelayInMs",
|
||||||
current_delay_ms);
|
current_delay_ms);
|
||||||
RTC_LOG(LS_INFO) << "WebRTC.Video.CurrentDelayInMs " << current_delay_ms;
|
logStream << "WebRTC.Video.CurrentDelayInMs " << current_delay_ms << "\n";
|
||||||
}
|
}
|
||||||
int delay_ms = delay_counter_.Avg(kMinRequiredSamples);
|
int delay_ms = delay_counter_.Avg(kMinRequiredSamples);
|
||||||
if (delay_ms != -1)
|
if (delay_ms != -1)
|
||||||
@ -272,15 +273,15 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
|
|||||||
if (e2e_delay_ms != -1) {
|
if (e2e_delay_ms != -1) {
|
||||||
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
||||||
uma_prefix + ".EndToEndDelayInMs" + uma_suffix, e2e_delay_ms);
|
uma_prefix + ".EndToEndDelayInMs" + uma_suffix, e2e_delay_ms);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix << ".EndToEndDelayInMs" << uma_suffix
|
logStream << uma_prefix << ".EndToEndDelayInMs" << uma_suffix
|
||||||
<< " " << e2e_delay_ms;
|
<< " " << e2e_delay_ms << "\n";
|
||||||
}
|
}
|
||||||
int e2e_delay_max_ms = stats.e2e_delay_counter.Max();
|
int e2e_delay_max_ms = stats.e2e_delay_counter.Max();
|
||||||
if (e2e_delay_max_ms != -1 && e2e_delay_ms != -1) {
|
if (e2e_delay_max_ms != -1 && e2e_delay_ms != -1) {
|
||||||
RTC_HISTOGRAM_COUNTS_SPARSE_100000(
|
RTC_HISTOGRAM_COUNTS_SPARSE_100000(
|
||||||
uma_prefix + ".EndToEndDelayMaxInMs" + uma_suffix, e2e_delay_max_ms);
|
uma_prefix + ".EndToEndDelayMaxInMs" + uma_suffix, e2e_delay_max_ms);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix << ".EndToEndDelayMaxInMs" << uma_suffix
|
logStream << uma_prefix << ".EndToEndDelayMaxInMs" << uma_suffix
|
||||||
<< " " << e2e_delay_max_ms;
|
<< " " << e2e_delay_max_ms << "\n";
|
||||||
}
|
}
|
||||||
int interframe_delay_ms =
|
int interframe_delay_ms =
|
||||||
stats.interframe_delay_counter.Avg(kMinRequiredSamples);
|
stats.interframe_delay_counter.Avg(kMinRequiredSamples);
|
||||||
@ -288,16 +289,16 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
|
|||||||
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
||||||
uma_prefix + ".InterframeDelayInMs" + uma_suffix,
|
uma_prefix + ".InterframeDelayInMs" + uma_suffix,
|
||||||
interframe_delay_ms);
|
interframe_delay_ms);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix << ".InterframeDelayInMs" << uma_suffix
|
logStream << uma_prefix << ".InterframeDelayInMs" << uma_suffix
|
||||||
<< " " << interframe_delay_ms;
|
<< " " << interframe_delay_ms << "\n";
|
||||||
}
|
}
|
||||||
int interframe_delay_max_ms = stats.interframe_delay_counter.Max();
|
int interframe_delay_max_ms = stats.interframe_delay_counter.Max();
|
||||||
if (interframe_delay_max_ms != -1 && interframe_delay_ms != -1) {
|
if (interframe_delay_max_ms != -1 && interframe_delay_ms != -1) {
|
||||||
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
||||||
uma_prefix + ".InterframeDelayMaxInMs" + uma_suffix,
|
uma_prefix + ".InterframeDelayMaxInMs" + uma_suffix,
|
||||||
interframe_delay_max_ms);
|
interframe_delay_max_ms);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix << ".InterframeDelayMaxInMs" << uma_suffix
|
logStream << uma_prefix << ".InterframeDelayMaxInMs" << uma_suffix
|
||||||
<< " " << interframe_delay_max_ms;
|
<< " " << interframe_delay_max_ms << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
rtc::Optional<uint32_t> interframe_delay_95p_ms =
|
rtc::Optional<uint32_t> interframe_delay_95p_ms =
|
||||||
@ -306,24 +307,24 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
|
|||||||
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
||||||
uma_prefix + ".InterframeDelay95PercentileInMs" + uma_suffix,
|
uma_prefix + ".InterframeDelay95PercentileInMs" + uma_suffix,
|
||||||
*interframe_delay_95p_ms);
|
*interframe_delay_95p_ms);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix << ".InterframeDelay95PercentileInMs"
|
logStream << uma_prefix << ".InterframeDelay95PercentileInMs"
|
||||||
<< uma_suffix << " " << *interframe_delay_95p_ms;
|
<< uma_suffix << " " << *interframe_delay_95p_ms << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int width = stats.received_width.Avg(kMinRequiredSamples);
|
int width = stats.received_width.Avg(kMinRequiredSamples);
|
||||||
if (width != -1) {
|
if (width != -1) {
|
||||||
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
||||||
uma_prefix + ".ReceivedWidthInPixels" + uma_suffix, width);
|
uma_prefix + ".ReceivedWidthInPixels" + uma_suffix, width);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix << ".ReceivedWidthInPixels" << uma_suffix
|
logStream << uma_prefix << ".ReceivedWidthInPixels" << uma_suffix
|
||||||
<< " " << width;
|
<< " " << width << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int height = stats.received_height.Avg(kMinRequiredSamples);
|
int height = stats.received_height.Avg(kMinRequiredSamples);
|
||||||
if (height != -1) {
|
if (height != -1) {
|
||||||
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
||||||
uma_prefix + ".ReceivedHeightInPixels" + uma_suffix, height);
|
uma_prefix + ".ReceivedHeightInPixels" + uma_suffix, height);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix << ".ReceivedHeightInPixels" << uma_suffix
|
logStream << uma_prefix << ".ReceivedHeightInPixels" << uma_suffix
|
||||||
<< " " << height;
|
<< " " << height << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (content_type != VideoContentType::UNSPECIFIED) {
|
if (content_type != VideoContentType::UNSPECIFIED) {
|
||||||
@ -336,8 +337,8 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
|
|||||||
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
|
||||||
uma_prefix + ".MediaBitrateReceivedInKbps" + uma_suffix,
|
uma_prefix + ".MediaBitrateReceivedInKbps" + uma_suffix,
|
||||||
media_bitrate_kbps);
|
media_bitrate_kbps);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix << ".MediaBitrateReceivedInKbps"
|
logStream << uma_prefix << ".MediaBitrateReceivedInKbps"
|
||||||
<< uma_suffix << " " << media_bitrate_kbps;
|
<< uma_suffix << " " << media_bitrate_kbps << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int num_total_frames =
|
int num_total_frames =
|
||||||
@ -349,16 +350,16 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
|
|||||||
RTC_HISTOGRAM_COUNTS_SPARSE_1000(
|
RTC_HISTOGRAM_COUNTS_SPARSE_1000(
|
||||||
uma_prefix + ".KeyFramesReceivedInPermille" + uma_suffix,
|
uma_prefix + ".KeyFramesReceivedInPermille" + uma_suffix,
|
||||||
key_frames_permille);
|
key_frames_permille);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix << ".KeyFramesReceivedInPermille"
|
logStream << uma_prefix << ".KeyFramesReceivedInPermille"
|
||||||
<< uma_suffix << " " << key_frames_permille;
|
<< uma_suffix << " " << key_frames_permille << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int qp = stats.qp_counter.Avg(kMinRequiredSamples);
|
int qp = stats.qp_counter.Avg(kMinRequiredSamples);
|
||||||
if (qp != -1) {
|
if (qp != -1) {
|
||||||
RTC_HISTOGRAM_COUNTS_SPARSE_200(
|
RTC_HISTOGRAM_COUNTS_SPARSE_200(
|
||||||
uma_prefix + ".Decoded.Vp8.Qp" + uma_suffix, qp);
|
uma_prefix + ".Decoded.Vp8.Qp" + uma_suffix, qp);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix << ".Decoded.Vp8.Qp" << uma_suffix << " "
|
logStream << uma_prefix << ".Decoded.Vp8.Qp" << uma_suffix << " "
|
||||||
<< qp;
|
<< qp << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -380,8 +381,8 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
|
|||||||
static_cast<int>(rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000);
|
static_cast<int>(rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000);
|
||||||
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.MediaBitrateReceivedInKbps",
|
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.MediaBitrateReceivedInKbps",
|
||||||
media_bitrate_kbs);
|
media_bitrate_kbs);
|
||||||
RTC_LOG(LS_INFO) << "WebRTC.Video.MediaBitrateReceivedInKbps "
|
logStream << "WebRTC.Video.MediaBitrateReceivedInKbps "
|
||||||
<< media_bitrate_kbs;
|
<< media_bitrate_kbs << "\n";
|
||||||
RTC_HISTOGRAM_COUNTS_10000(
|
RTC_HISTOGRAM_COUNTS_10000(
|
||||||
"WebRTC.Video.PaddingBitrateReceivedInKbps",
|
"WebRTC.Video.PaddingBitrateReceivedInKbps",
|
||||||
static_cast<int>(rtp_rtx.transmitted.padding_bytes * 8 / elapsed_sec /
|
static_cast<int>(rtp_rtx.transmitted.padding_bytes * 8 / elapsed_sec /
|
||||||
@ -435,6 +436,7 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
|
|||||||
RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.BadCall.Qp",
|
RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.BadCall.Qp",
|
||||||
static_cast<int>(100 * *qp_fraction));
|
static_cast<int>(100 * *qp_fraction));
|
||||||
}
|
}
|
||||||
|
RTC_LOG(LS_INFO) << logStream.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReceiveStatisticsProxy::QualitySample() {
|
void ReceiveStatisticsProxy::QualitySample() {
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <sstream>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "common_types.h" // NOLINT(build/include)
|
#include "common_types.h" // NOLINT(build/include)
|
||||||
@ -267,6 +268,7 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
|||||||
RTC_DCHECK(uma_prefix_ == kRealtimePrefix || uma_prefix_ == kScreenPrefix);
|
RTC_DCHECK(uma_prefix_ == kRealtimePrefix || uma_prefix_ == kScreenPrefix);
|
||||||
const int kIndex = uma_prefix_ == kScreenPrefix ? 1 : 0;
|
const int kIndex = uma_prefix_ == kScreenPrefix ? 1 : 0;
|
||||||
const int kMinRequiredPeriodicSamples = 6;
|
const int kMinRequiredPeriodicSamples = 6;
|
||||||
|
std::ostringstream logStream;
|
||||||
int in_width = input_width_counter_.Avg(kMinRequiredMetricsSamples);
|
int in_width = input_width_counter_.Avg(kMinRequiredMetricsSamples);
|
||||||
int in_height = input_height_counter_.Avg(kMinRequiredMetricsSamples);
|
int in_height = input_height_counter_.Avg(kMinRequiredMetricsSamples);
|
||||||
if (in_width != -1) {
|
if (in_width != -1) {
|
||||||
@ -274,15 +276,15 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
|||||||
in_width);
|
in_width);
|
||||||
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "InputHeightInPixels",
|
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "InputHeightInPixels",
|
||||||
in_height);
|
in_height);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "InputWidthInPixels " << in_width;
|
logStream << uma_prefix_ << "InputWidthInPixels " << in_width << "\n"
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "InputHeightInPixels " << in_height;
|
<< uma_prefix_ << "InputHeightInPixels " << in_height << "\n";
|
||||||
}
|
}
|
||||||
AggregatedStats in_fps = input_fps_counter_.GetStats();
|
AggregatedStats in_fps = input_fps_counter_.GetStats();
|
||||||
if (in_fps.num_samples >= kMinRequiredPeriodicSamples) {
|
if (in_fps.num_samples >= kMinRequiredPeriodicSamples) {
|
||||||
RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "InputFramesPerSecond",
|
RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "InputFramesPerSecond",
|
||||||
in_fps.average);
|
in_fps.average);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ + "InputFramesPerSecond, "
|
logStream << uma_prefix_ << "InputFramesPerSecond "
|
||||||
<< in_fps.ToString();
|
<< in_fps.ToString() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int sent_width = sent_width_counter_.Avg(kMinRequiredMetricsSamples);
|
int sent_width = sent_width_counter_.Avg(kMinRequiredMetricsSamples);
|
||||||
@ -292,15 +294,15 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
|||||||
sent_width);
|
sent_width);
|
||||||
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "SentHeightInPixels",
|
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "SentHeightInPixels",
|
||||||
sent_height);
|
sent_height);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "SentWidthInPixels " << sent_width;
|
logStream << uma_prefix_ << "SentWidthInPixels " << sent_width << "\n"
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "SentHeightInPixels " << sent_height;
|
<< uma_prefix_ << "SentHeightInPixels " << sent_height << "\n";
|
||||||
}
|
}
|
||||||
AggregatedStats sent_fps = sent_fps_counter_.GetStats();
|
AggregatedStats sent_fps = sent_fps_counter_.GetStats();
|
||||||
if (sent_fps.num_samples >= kMinRequiredPeriodicSamples) {
|
if (sent_fps.num_samples >= kMinRequiredPeriodicSamples) {
|
||||||
RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "SentFramesPerSecond",
|
RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "SentFramesPerSecond",
|
||||||
sent_fps.average);
|
sent_fps.average);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ + "SentFramesPerSecond, "
|
logStream << uma_prefix_ << "SentFramesPerSecond "
|
||||||
<< sent_fps.ToString();
|
<< sent_fps.ToString() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_fps.num_samples > kMinRequiredPeriodicSamples &&
|
if (in_fps.num_samples > kMinRequiredPeriodicSamples &&
|
||||||
@ -318,8 +320,8 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
|||||||
RTC_HISTOGRAMS_PERCENTAGE(kIndex,
|
RTC_HISTOGRAMS_PERCENTAGE(kIndex,
|
||||||
uma_prefix_ + "SentToInputFpsRatioPercent",
|
uma_prefix_ + "SentToInputFpsRatioPercent",
|
||||||
sent_to_in_fps_ratio_percent);
|
sent_to_in_fps_ratio_percent);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "SentToInputFpsRatioPercent "
|
logStream << uma_prefix_ << "SentToInputFpsRatioPercent "
|
||||||
<< sent_to_in_fps_ratio_percent;
|
<< sent_to_in_fps_ratio_percent << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,15 +329,15 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
|||||||
if (encode_ms != -1) {
|
if (encode_ms != -1) {
|
||||||
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "EncodeTimeInMs",
|
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "EncodeTimeInMs",
|
||||||
encode_ms);
|
encode_ms);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "EncodeTimeInMs " << encode_ms;
|
logStream << uma_prefix_ << "EncodeTimeInMs " << encode_ms << "\n";
|
||||||
}
|
}
|
||||||
int key_frames_permille =
|
int key_frames_permille =
|
||||||
key_frame_counter_.Permille(kMinRequiredMetricsSamples);
|
key_frame_counter_.Permille(kMinRequiredMetricsSamples);
|
||||||
if (key_frames_permille != -1) {
|
if (key_frames_permille != -1) {
|
||||||
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "KeyFramesSentInPermille",
|
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "KeyFramesSentInPermille",
|
||||||
key_frames_permille);
|
key_frames_permille);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "KeyFramesSentInPermille "
|
logStream << uma_prefix_ << "KeyFramesSentInPermille "
|
||||||
<< key_frames_permille;
|
<< key_frames_permille << "\n";
|
||||||
}
|
}
|
||||||
int quality_limited =
|
int quality_limited =
|
||||||
quality_limited_frame_counter_.Percent(kMinRequiredMetricsSamples);
|
quality_limited_frame_counter_.Percent(kMinRequiredMetricsSamples);
|
||||||
@ -343,8 +345,8 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
|||||||
RTC_HISTOGRAMS_PERCENTAGE(kIndex,
|
RTC_HISTOGRAMS_PERCENTAGE(kIndex,
|
||||||
uma_prefix_ + "QualityLimitedResolutionInPercent",
|
uma_prefix_ + "QualityLimitedResolutionInPercent",
|
||||||
quality_limited);
|
quality_limited);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "QualityLimitedResolutionInPercent "
|
logStream << uma_prefix_ << "QualityLimitedResolutionInPercent "
|
||||||
<< quality_limited;
|
<< quality_limited << "\n";
|
||||||
}
|
}
|
||||||
int downscales = quality_downscales_counter_.Avg(kMinRequiredMetricsSamples);
|
int downscales = quality_downscales_counter_.Avg(kMinRequiredMetricsSamples);
|
||||||
if (downscales != -1) {
|
if (downscales != -1) {
|
||||||
@ -467,8 +469,8 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
|||||||
if (fraction_lost != -1) {
|
if (fraction_lost != -1) {
|
||||||
RTC_HISTOGRAMS_PERCENTAGE(
|
RTC_HISTOGRAMS_PERCENTAGE(
|
||||||
kIndex, uma_prefix_ + "SentPacketsLostInPercent", fraction_lost);
|
kIndex, uma_prefix_ + "SentPacketsLostInPercent", fraction_lost);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "SentPacketsLostInPercent "
|
logStream << uma_prefix_ << "SentPacketsLostInPercent "
|
||||||
<< fraction_lost;
|
<< fraction_lost;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The RTCP packet type counters, delivered via the
|
// The RTCP packet type counters, delivered via the
|
||||||
@ -515,16 +517,16 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
|||||||
if (elapsed_sec >= metrics::kMinRunTimeInSeconds) {
|
if (elapsed_sec >= metrics::kMinRunTimeInSeconds) {
|
||||||
RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "NumberOfPauseEvents",
|
RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "NumberOfPauseEvents",
|
||||||
target_rate_updates_.pause_resume_events);
|
target_rate_updates_.pause_resume_events);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "NumberOfPauseEvents "
|
logStream << uma_prefix_ << "NumberOfPauseEvents "
|
||||||
<< target_rate_updates_.pause_resume_events;
|
<< target_rate_updates_.pause_resume_events << "\n";
|
||||||
|
|
||||||
int paused_time_percent =
|
int paused_time_percent =
|
||||||
paused_time_counter_.Percent(metrics::kMinRunTimeInSeconds * 1000);
|
paused_time_counter_.Percent(metrics::kMinRunTimeInSeconds * 1000);
|
||||||
if (paused_time_percent != -1) {
|
if (paused_time_percent != -1) {
|
||||||
RTC_HISTOGRAMS_PERCENTAGE(kIndex, uma_prefix_ + "PausedTimeInPercent",
|
RTC_HISTOGRAMS_PERCENTAGE(kIndex, uma_prefix_ + "PausedTimeInPercent",
|
||||||
paused_time_percent);
|
paused_time_percent);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "PausedTimeInPercent "
|
logStream << uma_prefix_ << "PausedTimeInPercent "
|
||||||
<< paused_time_percent;
|
<< paused_time_percent << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -548,23 +550,23 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
|||||||
if (total_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
if (total_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
||||||
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "BitrateSentInKbps",
|
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "BitrateSentInKbps",
|
||||||
total_bytes_per_sec.average * 8 / 1000);
|
total_bytes_per_sec.average * 8 / 1000);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "BitrateSentInBps, "
|
logStream << uma_prefix_ << "BitrateSentInBps "
|
||||||
<< total_bytes_per_sec.ToStringWithMultiplier(8);
|
<< total_bytes_per_sec.ToStringWithMultiplier(8) << "\n";
|
||||||
}
|
}
|
||||||
AggregatedStats media_bytes_per_sec = media_byte_counter_.GetStats();
|
AggregatedStats media_bytes_per_sec = media_byte_counter_.GetStats();
|
||||||
if (media_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
if (media_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
||||||
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "MediaBitrateSentInKbps",
|
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "MediaBitrateSentInKbps",
|
||||||
media_bytes_per_sec.average * 8 / 1000);
|
media_bytes_per_sec.average * 8 / 1000);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "MediaBitrateSentInBps, "
|
logStream << uma_prefix_ << "MediaBitrateSentInBps "
|
||||||
<< media_bytes_per_sec.ToStringWithMultiplier(8);
|
<< media_bytes_per_sec.ToStringWithMultiplier(8) << "\n";
|
||||||
}
|
}
|
||||||
AggregatedStats padding_bytes_per_sec = padding_byte_counter_.GetStats();
|
AggregatedStats padding_bytes_per_sec = padding_byte_counter_.GetStats();
|
||||||
if (padding_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
if (padding_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
||||||
RTC_HISTOGRAMS_COUNTS_10000(kIndex,
|
RTC_HISTOGRAMS_COUNTS_10000(kIndex,
|
||||||
uma_prefix_ + "PaddingBitrateSentInKbps",
|
uma_prefix_ + "PaddingBitrateSentInKbps",
|
||||||
padding_bytes_per_sec.average * 8 / 1000);
|
padding_bytes_per_sec.average * 8 / 1000);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "PaddingBitrateSentInBps, "
|
logStream << uma_prefix_ << "PaddingBitrateSentInBps "
|
||||||
<< padding_bytes_per_sec.ToStringWithMultiplier(8);
|
<< padding_bytes_per_sec.ToStringWithMultiplier(8) << "\n";
|
||||||
}
|
}
|
||||||
AggregatedStats retransmit_bytes_per_sec =
|
AggregatedStats retransmit_bytes_per_sec =
|
||||||
retransmit_byte_counter_.GetStats();
|
retransmit_byte_counter_.GetStats();
|
||||||
@ -572,16 +574,16 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
|||||||
RTC_HISTOGRAMS_COUNTS_10000(kIndex,
|
RTC_HISTOGRAMS_COUNTS_10000(kIndex,
|
||||||
uma_prefix_ + "RetransmittedBitrateSentInKbps",
|
uma_prefix_ + "RetransmittedBitrateSentInKbps",
|
||||||
retransmit_bytes_per_sec.average * 8 / 1000);
|
retransmit_bytes_per_sec.average * 8 / 1000);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "RetransmittedBitrateSentInBps, "
|
logStream << uma_prefix_ << "RetransmittedBitrateSentInBps "
|
||||||
<< retransmit_bytes_per_sec.ToStringWithMultiplier(8);
|
<< retransmit_bytes_per_sec.ToStringWithMultiplier(8) << "\n";
|
||||||
}
|
}
|
||||||
if (!rtp_config.rtx.ssrcs.empty()) {
|
if (!rtp_config.rtx.ssrcs.empty()) {
|
||||||
AggregatedStats rtx_bytes_per_sec = rtx_byte_counter_.GetStats();
|
AggregatedStats rtx_bytes_per_sec = rtx_byte_counter_.GetStats();
|
||||||
int rtx_bytes_per_sec_avg = -1;
|
int rtx_bytes_per_sec_avg = -1;
|
||||||
if (rtx_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
if (rtx_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
||||||
rtx_bytes_per_sec_avg = rtx_bytes_per_sec.average;
|
rtx_bytes_per_sec_avg = rtx_bytes_per_sec.average;
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "RtxBitrateSentInBps, "
|
logStream << uma_prefix_ << "RtxBitrateSentInBps "
|
||||||
<< rtx_bytes_per_sec.ToStringWithMultiplier(8);
|
<< rtx_bytes_per_sec.ToStringWithMultiplier(8) << "\n";
|
||||||
} else if (total_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
} else if (total_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
||||||
rtx_bytes_per_sec_avg = 0; // RTX enabled but no RTX data sent, record 0.
|
rtx_bytes_per_sec_avg = 0; // RTX enabled but no RTX data sent, record 0.
|
||||||
}
|
}
|
||||||
@ -596,27 +598,29 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
|||||||
if (fec_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
if (fec_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
||||||
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "FecBitrateSentInKbps",
|
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "FecBitrateSentInKbps",
|
||||||
fec_bytes_per_sec.average * 8 / 1000);
|
fec_bytes_per_sec.average * 8 / 1000);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "FecBitrateSentInBps, "
|
logStream << uma_prefix_ << "FecBitrateSentInBps "
|
||||||
<< fec_bytes_per_sec.ToStringWithMultiplier(8);
|
<< fec_bytes_per_sec.ToStringWithMultiplier(8) << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RTC_LOG(LS_INFO) << "Frames encoded " << current_stats.frames_encoded;
|
logStream << "Frames encoded " << current_stats.frames_encoded << "\n"
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "DroppedFrames.Capturer "
|
<< uma_prefix_ << "DroppedFrames.Capturer "
|
||||||
<< current_stats.frames_dropped_by_capturer;
|
<< current_stats.frames_dropped_by_capturer << "\n";
|
||||||
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "DroppedFrames.Capturer",
|
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "DroppedFrames.Capturer",
|
||||||
current_stats.frames_dropped_by_capturer);
|
current_stats.frames_dropped_by_capturer);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "DroppedFrames.EncoderQueue "
|
logStream << uma_prefix_ << "DroppedFrames.EncoderQueue "
|
||||||
<< current_stats.frames_dropped_by_encoder_queue;
|
<< current_stats.frames_dropped_by_encoder_queue << "\n";
|
||||||
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "DroppedFrames.EncoderQueue",
|
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "DroppedFrames.EncoderQueue",
|
||||||
current_stats.frames_dropped_by_encoder_queue);
|
current_stats.frames_dropped_by_encoder_queue);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "DroppedFrames.Encoder "
|
logStream << uma_prefix_ << "DroppedFrames.Encoder "
|
||||||
<< current_stats.frames_dropped_by_encoder;
|
<< current_stats.frames_dropped_by_encoder << "\n";
|
||||||
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "DroppedFrames.Encoder",
|
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "DroppedFrames.Encoder",
|
||||||
current_stats.frames_dropped_by_encoder);
|
current_stats.frames_dropped_by_encoder);
|
||||||
RTC_LOG(LS_INFO) << uma_prefix_ << "DroppedFrames.Ratelimiter "
|
logStream << uma_prefix_ << "DroppedFrames.Ratelimiter "
|
||||||
<< current_stats.frames_dropped_by_rate_limiter;
|
<< current_stats.frames_dropped_by_rate_limiter;
|
||||||
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "DroppedFrames.Ratelimiter",
|
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "DroppedFrames.Ratelimiter",
|
||||||
current_stats.frames_dropped_by_rate_limiter);
|
current_stats.frames_dropped_by_rate_limiter);
|
||||||
|
|
||||||
|
RTC_LOG(LS_INFO) << logStream.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendStatisticsProxy::OnEncoderReconfigured(
|
void SendStatisticsProxy::OnEncoderReconfigured(
|
||||||
|
Reference in New Issue
Block a user