Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1342)

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 1788783002: Add macros for ability to log samples that are added to histograms (RTC_LOGGED_*). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/receive_statistics_proxy.cc ('k') | webrtc/video/vie_receiver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/send_statistics_proxy.cc
diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc
index 6407cdc62ea8e2257994ef90291f60c81ec42294..6c689bfcdb443d7c30c27328435e2a3fc0aafdc5 100644
--- a/webrtc/video/send_statistics_proxy.cc
+++ b/webrtc/video/send_statistics_proxy.cc
@@ -13,6 +13,7 @@
#include <algorithm>
#include <cmath>
#include <map>
+#include <vector>
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
@@ -128,68 +129,68 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
int in_height = input_height_counter_.Avg(kMinRequiredSamples);
int in_fps = round(input_frame_rate_tracker_.ComputeTotalRate());
if (in_width != -1) {
- RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "InputWidthInPixels",
- in_width);
- RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "InputHeightInPixels",
- in_height);
- RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "InputFramesPerSecond",
- in_fps);
+ RTC_LOGGED_HISTOGRAMS_COUNTS_10000(
+ kIndex, uma_prefix_ + "InputWidthInPixels", in_width);
+ RTC_LOGGED_HISTOGRAMS_COUNTS_10000(
+ kIndex, uma_prefix_ + "InputHeightInPixels", in_height);
+ RTC_LOGGED_HISTOGRAMS_COUNTS_100(
+ kIndex, uma_prefix_ + "InputFramesPerSecond", in_fps);
}
int sent_width = sent_width_counter_.Avg(kMinRequiredSamples);
int sent_height = sent_height_counter_.Avg(kMinRequiredSamples);
int sent_fps = round(sent_frame_rate_tracker_.ComputeTotalRate());
if (sent_width != -1) {
- RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "SentWidthInPixels",
- sent_width);
- RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "SentHeightInPixels",
- sent_height);
- RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "SentFramesPerSecond",
- sent_fps);
+ RTC_LOGGED_HISTOGRAMS_COUNTS_10000(
+ kIndex, uma_prefix_ + "SentWidthInPixels", sent_width);
+ RTC_LOGGED_HISTOGRAMS_COUNTS_10000(
+ kIndex, uma_prefix_ + "SentHeightInPixels", sent_height);
+ RTC_LOGGED_HISTOGRAMS_COUNTS_100(
+ kIndex, uma_prefix_ + "SentFramesPerSecond", sent_fps);
}
int encode_ms = encode_time_counter_.Avg(kMinRequiredSamples);
if (encode_ms != -1) {
- RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "EncodeTimeInMs",
- encode_ms);
+ RTC_LOGGED_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "EncodeTimeInMs",
+ encode_ms);
}
int key_frames_permille = key_frame_counter_.Permille(kMinRequiredSamples);
if (key_frames_permille != -1) {
- RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "KeyFramesSentInPermille",
- key_frames_permille);
+ RTC_LOGGED_HISTOGRAMS_COUNTS_1000(
+ kIndex, uma_prefix_ + "KeyFramesSentInPermille", key_frames_permille);
}
int quality_limited =
quality_limited_frame_counter_.Percent(kMinRequiredSamples);
if (quality_limited != -1) {
- RTC_HISTOGRAMS_PERCENTAGE(kIndex,
- uma_prefix_ + "QualityLimitedResolutionInPercent",
- quality_limited);
+ RTC_LOGGED_HISTOGRAMS_PERCENTAGE(
+ kIndex, uma_prefix_ + "QualityLimitedResolutionInPercent",
+ quality_limited);
}
int downscales = quality_downscales_counter_.Avg(kMinRequiredSamples);
if (downscales != -1) {
- RTC_HISTOGRAMS_ENUMERATION(
+ RTC_LOGGED_HISTOGRAMS_ENUMERATION(
kIndex, uma_prefix_ + "QualityLimitedResolutionDownscales", downscales,
20);
}
int bw_limited = bw_limited_frame_counter_.Percent(kMinRequiredSamples);
if (bw_limited != -1) {
- RTC_HISTOGRAMS_PERCENTAGE(
+ RTC_LOGGED_HISTOGRAMS_PERCENTAGE(
kIndex, uma_prefix_ + "BandwidthLimitedResolutionInPercent",
bw_limited);
}
int num_disabled = bw_resolutions_disabled_counter_.Avg(kMinRequiredSamples);
if (num_disabled != -1) {
- RTC_HISTOGRAMS_ENUMERATION(
+ RTC_LOGGED_HISTOGRAMS_ENUMERATION(
kIndex, uma_prefix_ + "BandwidthLimitedResolutionsDisabled",
num_disabled, 10);
}
int delay_ms = delay_counter_.Avg(kMinRequiredSamples);
if (delay_ms != -1)
- RTC_HISTOGRAMS_COUNTS_100000(kIndex, uma_prefix_ + "SendSideDelayInMs",
- delay_ms);
+ RTC_LOGGED_HISTOGRAMS_COUNTS_100000(
+ kIndex, uma_prefix_ + "SendSideDelayInMs", delay_ms);
int max_delay_ms = max_delay_counter_.Avg(kMinRequiredSamples);
if (max_delay_ms != -1) {
- RTC_HISTOGRAMS_COUNTS_100000(kIndex, uma_prefix_ + "SendSideDelayMaxInMs",
- max_delay_ms);
+ RTC_LOGGED_HISTOGRAMS_COUNTS_100000(
+ kIndex, uma_prefix_ + "SendSideDelayMaxInMs", max_delay_ms);
}
if (first_rtcp_stats_time_ms_ != -1) {
@@ -198,7 +199,7 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
if (elapsed_sec >= metrics::kMinRunTimeInSeconds) {
int fraction_lost = report_block_stats_.FractionLostInPercent();
if (fraction_lost != -1) {
- RTC_HISTOGRAMS_PERCENTAGE(
+ RTC_LOGGED_HISTOGRAMS_PERCENTAGE(
kIndex, uma_prefix_ + "SentPacketsLostInPercent", fraction_lost);
}
@@ -223,17 +224,17 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
counters.Add(stream_counters);
}
- RTC_HISTOGRAMS_COUNTS_10000(kIndex,
- uma_prefix_ + "NackPacketsReceivedPerMinute",
- counters.nack_packets * 60 / elapsed_sec);
- RTC_HISTOGRAMS_COUNTS_10000(kIndex,
- uma_prefix_ + "FirPacketsReceivedPerMinute",
- counters.fir_packets * 60 / elapsed_sec);
- RTC_HISTOGRAMS_COUNTS_10000(kIndex,
- uma_prefix_ + "PliPacketsReceivedPerMinute",
- counters.pli_packets * 60 / elapsed_sec);
+ RTC_LOGGED_HISTOGRAMS_COUNTS_10000(
+ kIndex, uma_prefix_ + "NackPacketsReceivedPerMinute",
+ counters.nack_packets * 60 / elapsed_sec);
+ RTC_LOGGED_HISTOGRAMS_COUNTS_10000(
+ kIndex, uma_prefix_ + "FirPacketsReceivedPerMinute",
+ counters.fir_packets * 60 / elapsed_sec);
+ RTC_LOGGED_HISTOGRAMS_COUNTS_10000(
+ kIndex, uma_prefix_ + "PliPacketsReceivedPerMinute",
+ counters.pli_packets * 60 / elapsed_sec);
if (counters.nack_requests > 0) {
- RTC_HISTOGRAMS_PERCENTAGE(
+ RTC_LOGGED_HISTOGRAMS_PERCENTAGE(
kIndex, uma_prefix_ + "UniqueNackRequestsReceivedInPercent",
counters.UniqueNackRequestsInPercent());
}
@@ -255,32 +256,32 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
StreamDataCounters rtp_rtx = rtp;
rtp_rtx.Add(rtx);
- RTC_HISTOGRAMS_COUNTS_10000(
+ RTC_LOGGED_HISTOGRAMS_COUNTS_10000(
kIndex, uma_prefix_ + "BitrateSentInKbps",
static_cast<int>(rtp_rtx.transmitted.TotalBytes() * 8 / elapsed_sec /
1000));
- RTC_HISTOGRAMS_COUNTS_10000(
+ RTC_LOGGED_HISTOGRAMS_COUNTS_10000(
kIndex, uma_prefix_ + "MediaBitrateSentInKbps",
static_cast<int>(rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000));
- RTC_HISTOGRAMS_COUNTS_10000(
+ RTC_LOGGED_HISTOGRAMS_COUNTS_10000(
kIndex, uma_prefix_ + "PaddingBitrateSentInKbps",
static_cast<int>(rtp_rtx.transmitted.padding_bytes * 8 / elapsed_sec /
1000));
- RTC_HISTOGRAMS_COUNTS_10000(
+ RTC_LOGGED_HISTOGRAMS_COUNTS_10000(
kIndex, uma_prefix_ + "RetransmittedBitrateSentInKbps",
static_cast<int>(rtp_rtx.retransmitted.TotalBytes() * 8 /
elapsed_sec / 1000));
if (!config.rtp.rtx.ssrcs.empty()) {
- RTC_HISTOGRAMS_COUNTS_10000(
+ RTC_LOGGED_HISTOGRAMS_COUNTS_10000(
kIndex, uma_prefix_ + "RtxBitrateSentInKbps",
static_cast<int>(rtx.transmitted.TotalBytes() * 8 / elapsed_sec /
1000));
}
if (config.rtp.fec.red_payload_type != -1) {
- RTC_HISTOGRAMS_COUNTS_10000(kIndex,
- uma_prefix_ + "FecBitrateSentInKbps",
- static_cast<int>(rtp_rtx.fec.TotalBytes() *
- 8 / elapsed_sec / 1000));
+ RTC_LOGGED_HISTOGRAMS_COUNTS_10000(
+ kIndex, uma_prefix_ + "FecBitrateSentInKbps",
+ static_cast<int>(rtp_rtx.fec.TotalBytes() * 8 / elapsed_sec /
+ 1000));
}
}
}
« no previous file with comments | « webrtc/video/receive_statistics_proxy.cc ('k') | webrtc/video/vie_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698