Rename RTC_HISTOGRAM_* macros to RTC_HISTOGRAM_*_SPARSE_* to indicate that these are for infrequent updates.
This implementation will be replaced by a faster one and sparse will be removed.
BUG=webrtc:5283
Review URL: https://codereview.webrtc.org/1530913002
Cr-Commit-Position: refs/heads/master@{#11099}
diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module_impl.cc b/webrtc/modules/audio_coding/acm2/audio_coding_module_impl.cc
index 0572b26..b434da2 100644
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module_impl.cc
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module_impl.cc
@@ -97,7 +97,7 @@
if (value != last_value_ || first_time_) {
first_time_ = false;
last_value_ = value;
- RTC_HISTOGRAM_COUNTS_100(histogram_name_, value);
+ RTC_HISTOGRAM_COUNTS_SPARSE_100(histogram_name_, value);
}
}
diff --git a/webrtc/modules/audio_coding/neteq/statistics_calculator.cc b/webrtc/modules/audio_coding/neteq/statistics_calculator.cc
index e6a6fbf..8f87376 100644
--- a/webrtc/modules/audio_coding/neteq/statistics_calculator.cc
+++ b/webrtc/modules/audio_coding/neteq/statistics_calculator.cc
@@ -50,7 +50,7 @@
}
void StatisticsCalculator::PeriodicUmaLogger::LogToUma(int value) const {
- RTC_HISTOGRAM_COUNTS(uma_name_, value, 1, max_value_, 50);
+ RTC_HISTOGRAM_COUNTS_SPARSE(uma_name_, value, 1, max_value_, 50);
}
StatisticsCalculator::PeriodicUmaCount::PeriodicUmaCount(
@@ -187,9 +187,9 @@
}
void StatisticsCalculator::LogDelayedPacketOutageEvent(int outage_duration_ms) {
- RTC_HISTOGRAM_COUNTS("WebRTC.Audio.DelayedPacketOutageEventMs",
- outage_duration_ms, 1 /* min */, 2000 /* max */,
- 100 /* bucket count */);
+ RTC_HISTOGRAM_COUNTS_SPARSE("WebRTC.Audio.DelayedPacketOutageEventMs",
+ outage_duration_ms, 1 /* min */, 2000 /* max */,
+ 100 /* bucket count */);
delayed_packet_outage_counter_.RegisterSample();
}
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc
index a332945..c0c5e8a 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -1346,8 +1346,9 @@
capture_nonlocked_.stream_delay_ms - capture_.last_stream_delay_ms;
if (diff_stream_delay_ms > kMinDiffDelayMs &&
capture_.last_stream_delay_ms != 0) {
- RTC_HISTOGRAM_COUNTS("WebRTC.Audio.PlatformReportedStreamDelayJump",
- diff_stream_delay_ms, kMinDiffDelayMs, 1000, 100);
+ RTC_HISTOGRAM_COUNTS_SPARSE(
+ "WebRTC.Audio.PlatformReportedStreamDelayJump", diff_stream_delay_ms,
+ kMinDiffDelayMs, 1000, 100);
if (capture_.stream_delay_jumps == -1) {
capture_.stream_delay_jumps = 0; // Activate counter if needed.
}
@@ -1364,9 +1365,9 @@
aec_system_delay_ms - capture_.last_aec_system_delay_ms;
if (diff_aec_system_delay_ms > kMinDiffDelayMs &&
capture_.last_aec_system_delay_ms != 0) {
- RTC_HISTOGRAM_COUNTS("WebRTC.Audio.AecSystemDelayJump",
- diff_aec_system_delay_ms, kMinDiffDelayMs, 1000,
- 100);
+ RTC_HISTOGRAM_COUNTS_SPARSE("WebRTC.Audio.AecSystemDelayJump",
+ diff_aec_system_delay_ms, kMinDiffDelayMs,
+ 1000, 100);
if (capture_.aec_system_delay_jumps == -1) {
capture_.aec_system_delay_jumps = 0; // Activate counter if needed.
}
@@ -1382,7 +1383,7 @@
rtc::CritScope cs_capture(&crit_capture_);
if (capture_.stream_delay_jumps > -1) {
- RTC_HISTOGRAM_ENUMERATION(
+ RTC_HISTOGRAM_ENUMERATION_SPARSE(
"WebRTC.Audio.NumOfPlatformReportedStreamDelayJumps",
capture_.stream_delay_jumps, 51);
}
@@ -1390,8 +1391,8 @@
capture_.last_stream_delay_ms = 0;
if (capture_.aec_system_delay_jumps > -1) {
- RTC_HISTOGRAM_ENUMERATION("WebRTC.Audio.NumOfAecSystemDelayJumps",
- capture_.aec_system_delay_jumps, 51);
+ RTC_HISTOGRAM_ENUMERATION_SPARSE("WebRTC.Audio.NumOfAecSystemDelayJumps",
+ capture_.aec_system_delay_jumps, 51);
}
capture_.aec_system_delay_jumps = -1;
capture_.last_aec_system_delay_ms = 0;
diff --git a/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc b/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc
index 96a3b47..258c4d9 100644
--- a/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc
+++ b/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.cc
@@ -146,8 +146,8 @@
for (size_t i = 0; i < kNumUmaRampupMetrics; ++i) {
if (!rampup_uma_stats_updated_[i] &&
bitrate_kbps >= kUmaRampupMetrics[i].bitrate_kbps) {
- RTC_HISTOGRAM_COUNTS_100000(kUmaRampupMetrics[i].metric_name,
- now_ms - first_report_time_ms_);
+ RTC_HISTOGRAM_COUNTS_SPARSE_100000(kUmaRampupMetrics[i].metric_name,
+ now_ms - first_report_time_ms_);
rampup_uma_stats_updated_[i] = true;
}
}
@@ -156,22 +156,19 @@
} else if (uma_update_state_ == kNoUpdate) {
uma_update_state_ = kFirstDone;
bitrate_at_2_seconds_kbps_ = bitrate_kbps;
- RTC_HISTOGRAM_COUNTS(
- "WebRTC.BWE.InitiallyLostPackets", initially_lost_packets_, 0, 100, 50);
- RTC_HISTOGRAM_COUNTS(
- "WebRTC.BWE.InitialRtt", static_cast<int>(rtt), 0, 2000, 50);
- RTC_HISTOGRAM_COUNTS("WebRTC.BWE.InitialBandwidthEstimate",
- bitrate_at_2_seconds_kbps_,
- 0,
- 2000,
- 50);
+ RTC_HISTOGRAM_COUNTS_SPARSE("WebRTC.BWE.InitiallyLostPackets",
+ initially_lost_packets_, 0, 100, 50);
+ RTC_HISTOGRAM_COUNTS_SPARSE("WebRTC.BWE.InitialRtt", static_cast<int>(rtt),
+ 0, 2000, 50);
+ RTC_HISTOGRAM_COUNTS_SPARSE("WebRTC.BWE.InitialBandwidthEstimate",
+ bitrate_at_2_seconds_kbps_, 0, 2000, 50);
} else if (uma_update_state_ == kFirstDone &&
now_ms - first_report_time_ms_ >= kBweConverganceTimeMs) {
uma_update_state_ = kDone;
int bitrate_diff_kbps =
std::max(bitrate_at_2_seconds_kbps_ - bitrate_kbps, 0);
- RTC_HISTOGRAM_COUNTS(
- "WebRTC.BWE.InitialVsConvergedDiff", bitrate_diff_kbps, 0, 2000, 50);
+ RTC_HISTOGRAM_COUNTS_SPARSE("WebRTC.BWE.InitialVsConvergedDiff",
+ bitrate_diff_kbps, 0, 2000, 50);
}
}
diff --git a/webrtc/modules/video_coding/jitter_buffer.cc b/webrtc/modules/video_coding/jitter_buffer.cc
index a1142bb..a381880 100644
--- a/webrtc/modules/video_coding/jitter_buffer.cc
+++ b/webrtc/modules/video_coding/jitter_buffer.cc
@@ -281,17 +281,18 @@
return;
}
- RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.DiscardedPacketsInPercent",
- num_discarded_packets_ * 100 / num_packets_);
- RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.DuplicatedPacketsInPercent",
- num_duplicated_packets_ * 100 / num_packets_);
+ RTC_HISTOGRAM_PERCENTAGE_SPARSE("WebRTC.Video.DiscardedPacketsInPercent",
+ num_discarded_packets_ * 100 / num_packets_);
+ RTC_HISTOGRAM_PERCENTAGE_SPARSE("WebRTC.Video.DuplicatedPacketsInPercent",
+ num_duplicated_packets_ * 100 / num_packets_);
int total_frames =
receive_statistics_.key_frames + receive_statistics_.delta_frames;
if (total_frames > 0) {
- RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.CompleteFramesReceivedPerSecond",
+ RTC_HISTOGRAM_COUNTS_SPARSE_100(
+ "WebRTC.Video.CompleteFramesReceivedPerSecond",
static_cast<int>((total_frames / elapsed_sec) + 0.5f));
- RTC_HISTOGRAM_COUNTS_1000(
+ RTC_HISTOGRAM_COUNTS_SPARSE_1000(
"WebRTC.Video.KeyFramesReceivedInPermille",
static_cast<int>(
(receive_statistics_.key_frames * 1000.0f / total_frames) + 0.5f));
diff --git a/webrtc/modules/video_coding/timing.cc b/webrtc/modules/video_coding/timing.cc
index f1a127a..d2563a4 100644
--- a/webrtc/modules/video_coding/timing.cc
+++ b/webrtc/modules/video_coding/timing.cc
@@ -62,14 +62,16 @@
if (elapsed_sec < metrics::kMinRunTimeInSeconds) {
return;
}
- RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.DecodedFramesPerSecond",
+ RTC_HISTOGRAM_COUNTS_SPARSE_100(
+ "WebRTC.Video.DecodedFramesPerSecond",
static_cast<int>((num_decoded_frames_ / elapsed_sec) + 0.5f));
- RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.DelayedFramesToRenderer",
+ RTC_HISTOGRAM_PERCENTAGE_SPARSE(
+ "WebRTC.Video.DelayedFramesToRenderer",
num_delayed_decoded_frames_ * 100 / num_decoded_frames_);
if (num_delayed_decoded_frames_ > 0) {
- RTC_HISTOGRAM_COUNTS_1000(
+ RTC_HISTOGRAM_COUNTS_SPARSE_1000(
"WebRTC.Video.DelayedFramesToRenderer_AvgDelayInMs",
- sum_missed_render_deadline_ms_ / num_delayed_decoded_frames_);
+ sum_missed_render_deadline_ms_ / num_delayed_decoded_frames_);
}
}