Add directive to make webrtc metrics optional.
Bug: webrtc:11144
Change-Id: I4e75e6aec033784685de3670e880bb9f2b6ee8d2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161043
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30040}
diff --git a/video/end_to_end_tests/histogram_tests.cc b/video/end_to_end_tests/histogram_tests.cc
index ef435b4..dd6de25 100644
--- a/video/end_to_end_tests/histogram_tests.cc
+++ b/video/end_to_end_tests/histogram_tests.cc
@@ -150,113 +150,146 @@
const std::string video_suffix = screenshare ? ".S0" : "";
// Verify that stats have been updated once.
- EXPECT_EQ(2, metrics::NumSamples("WebRTC.Call.LifetimeInSeconds"));
- EXPECT_EQ(1, metrics::NumSamples(
- "WebRTC.Call.TimeReceivingVideoRtpPacketsInSeconds"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Call.VideoBitrateReceivedInKbps"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Call.RtcpBitrateReceivedInBps"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Call.BitrateReceivedInKbps"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Call.EstimatedSendBitrateInKbps"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Call.PacerBitrateInKbps"));
+ EXPECT_METRIC_EQ(2, metrics::NumSamples("WebRTC.Call.LifetimeInSeconds"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples(
+ "WebRTC.Call.TimeReceivingVideoRtpPacketsInSeconds"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples("WebRTC.Call.VideoBitrateReceivedInKbps"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples("WebRTC.Call.RtcpBitrateReceivedInBps"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples("WebRTC.Call.BitrateReceivedInKbps"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples("WebRTC.Call.EstimatedSendBitrateInKbps"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples("WebRTC.Call.PacerBitrateInKbps"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.SendStreamLifetimeInSeconds"));
- EXPECT_EQ(1,
- metrics::NumSamples("WebRTC.Video.ReceiveStreamLifetimeInSeconds"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples("WebRTC.Video.SendStreamLifetimeInSeconds"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples("WebRTC.Video.ReceiveStreamLifetimeInSeconds"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.NackPacketsSentPerMinute"));
- EXPECT_EQ(1,
- metrics::NumSamples(video_prefix + "NackPacketsReceivedPerMinute"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.FirPacketsSentPerMinute"));
- EXPECT_EQ(1,
- metrics::NumSamples(video_prefix + "FirPacketsReceivedPerMinute"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.PliPacketsSentPerMinute"));
- EXPECT_EQ(1,
- metrics::NumSamples(video_prefix + "PliPacketsReceivedPerMinute"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples("WebRTC.Video.NackPacketsSentPerMinute"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples(video_prefix + "NackPacketsReceivedPerMinute"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples("WebRTC.Video.FirPacketsSentPerMinute"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples(video_prefix + "FirPacketsReceivedPerMinute"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples("WebRTC.Video.PliPacketsSentPerMinute"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples(video_prefix + "PliPacketsReceivedPerMinute"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "KeyFramesSentInPermille"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.KeyFramesReceivedInPermille"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples(video_prefix + "KeyFramesSentInPermille"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples("WebRTC.Video.KeyFramesReceivedInPermille"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "SentPacketsLostInPercent"));
- EXPECT_EQ(1,
- metrics::NumSamples("WebRTC.Video.ReceivedPacketsLostInPercent"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples(video_prefix + "SentPacketsLostInPercent"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples("WebRTC.Video.ReceivedPacketsLostInPercent"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "InputWidthInPixels"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "InputHeightInPixels"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "SentWidthInPixels"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "SentHeightInPixels"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "ReceivedWidthInPixels"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "ReceivedHeightInPixels"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples(video_prefix + "InputWidthInPixels"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples(video_prefix + "InputHeightInPixels"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples(video_prefix + "SentWidthInPixels"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples(video_prefix + "SentHeightInPixels"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples(video_prefix + "ReceivedWidthInPixels"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples(video_prefix + "ReceivedHeightInPixels"));
- EXPECT_EQ(1, metrics::NumEvents(video_prefix + "InputWidthInPixels",
- kDefaultWidth));
- EXPECT_EQ(1, metrics::NumEvents(video_prefix + "InputHeightInPixels",
- kDefaultHeight));
- EXPECT_EQ(
+ EXPECT_METRIC_EQ(1, metrics::NumEvents(video_prefix + "InputWidthInPixels",
+ kDefaultWidth));
+ EXPECT_METRIC_EQ(1, metrics::NumEvents(video_prefix + "InputHeightInPixels",
+ kDefaultHeight));
+ EXPECT_METRIC_EQ(
1, metrics::NumEvents(video_prefix + "SentWidthInPixels", kDefaultWidth));
- EXPECT_EQ(1, metrics::NumEvents(video_prefix + "SentHeightInPixels",
- kDefaultHeight));
- EXPECT_EQ(1, metrics::NumEvents(video_prefix + "ReceivedWidthInPixels",
- kDefaultWidth));
- EXPECT_EQ(1, metrics::NumEvents(video_prefix + "ReceivedHeightInPixels",
- kDefaultHeight));
+ EXPECT_METRIC_EQ(1, metrics::NumEvents(video_prefix + "SentHeightInPixels",
+ kDefaultHeight));
+ EXPECT_METRIC_EQ(1, metrics::NumEvents(video_prefix + "ReceivedWidthInPixels",
+ kDefaultWidth));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumEvents(video_prefix + "ReceivedHeightInPixels",
+ kDefaultHeight));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "InputFramesPerSecond"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "SentFramesPerSecond"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.DecodedFramesPerSecond"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.RenderFramesPerSecond"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.DelayedFramesToRenderer"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples(video_prefix + "InputFramesPerSecond"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples(video_prefix + "SentFramesPerSecond"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples("WebRTC.Video.DecodedFramesPerSecond"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples("WebRTC.Video.RenderFramesPerSecond"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples("WebRTC.Video.DelayedFramesToRenderer"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.JitterBufferDelayInMs"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.TargetDelayInMs"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.CurrentDelayInMs"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.OnewayDelayInMs"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples("WebRTC.Video.JitterBufferDelayInMs"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples("WebRTC.Video.TargetDelayInMs"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples("WebRTC.Video.CurrentDelayInMs"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples("WebRTC.Video.OnewayDelayInMs"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "EndToEndDelayInMs" +
- video_suffix));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "EndToEndDelayMaxInMs" +
- video_suffix));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "InterframeDelayInMs" +
- video_suffix));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "InterframeDelayMaxInMs" +
- video_suffix));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples(video_prefix + "EndToEndDelayInMs" +
+ video_suffix));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples(video_prefix + "EndToEndDelayMaxInMs" +
+ video_suffix));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples(video_prefix + "InterframeDelayInMs" +
+ video_suffix));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples(video_prefix + "InterframeDelayMaxInMs" +
+ video_suffix));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.RenderSqrtPixelsPerSecond"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples("WebRTC.Video.RenderSqrtPixelsPerSecond"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "EncodeTimeInMs"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.DecodeTimeInMs"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples(video_prefix + "EncodeTimeInMs"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples("WebRTC.Video.DecodeTimeInMs"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "NumberOfPauseEvents"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "PausedTimeInPercent"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples(video_prefix + "NumberOfPauseEvents"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples(video_prefix + "PausedTimeInPercent"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "BitrateSentInKbps"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.BitrateReceivedInKbps"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "MediaBitrateSentInKbps"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.MediaBitrateReceivedInKbps"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "PaddingBitrateSentInKbps"));
- EXPECT_EQ(1,
- metrics::NumSamples("WebRTC.Video.PaddingBitrateReceivedInKbps"));
- EXPECT_EQ(
+ EXPECT_METRIC_EQ(1, metrics::NumSamples(video_prefix + "BitrateSentInKbps"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples("WebRTC.Video.BitrateReceivedInKbps"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples(video_prefix + "MediaBitrateSentInKbps"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples("WebRTC.Video.MediaBitrateReceivedInKbps"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples(video_prefix + "PaddingBitrateSentInKbps"));
+ EXPECT_METRIC_EQ(
+ 1, metrics::NumSamples("WebRTC.Video.PaddingBitrateReceivedInKbps"));
+ EXPECT_METRIC_EQ(
1, metrics::NumSamples(video_prefix + "RetransmittedBitrateSentInKbps"));
- EXPECT_EQ(1, metrics::NumSamples(
- "WebRTC.Video.RetransmittedBitrateReceivedInKbps"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples(
+ "WebRTC.Video.RetransmittedBitrateReceivedInKbps"));
- EXPECT_EQ(1, metrics::NumSamples("WebRTC.Video.SendDelayInMs"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "SendSideDelayInMs"));
- EXPECT_EQ(1, metrics::NumSamples(video_prefix + "SendSideDelayMaxInMs"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples("WebRTC.Video.SendDelayInMs"));
+ EXPECT_METRIC_EQ(1, metrics::NumSamples(video_prefix + "SendSideDelayInMs"));
+ EXPECT_METRIC_EQ(1,
+ metrics::NumSamples(video_prefix + "SendSideDelayMaxInMs"));
int num_rtx_samples = use_rtx ? 1 : 0;
- EXPECT_EQ(num_rtx_samples,
- metrics::NumSamples("WebRTC.Video.RtxBitrateSentInKbps"));
- EXPECT_EQ(num_rtx_samples,
- metrics::NumSamples("WebRTC.Video.RtxBitrateReceivedInKbps"));
+ EXPECT_METRIC_EQ(num_rtx_samples,
+ metrics::NumSamples("WebRTC.Video.RtxBitrateSentInKbps"));
+ EXPECT_METRIC_EQ(
+ num_rtx_samples,
+ metrics::NumSamples("WebRTC.Video.RtxBitrateReceivedInKbps"));
int num_red_samples = use_fec ? 1 : 0;
- EXPECT_EQ(num_red_samples,
- metrics::NumSamples("WebRTC.Video.FecBitrateSentInKbps"));
- EXPECT_EQ(num_red_samples,
- metrics::NumSamples("WebRTC.Video.FecBitrateReceivedInKbps"));
- EXPECT_EQ(num_red_samples,
- metrics::NumSamples("WebRTC.Video.ReceivedFecPacketsInPercent"));
+ EXPECT_METRIC_EQ(num_red_samples,
+ metrics::NumSamples("WebRTC.Video.FecBitrateSentInKbps"));
+ EXPECT_METRIC_EQ(
+ num_red_samples,
+ metrics::NumSamples("WebRTC.Video.FecBitrateReceivedInKbps"));
+ EXPECT_METRIC_EQ(
+ num_red_samples,
+ metrics::NumSamples("WebRTC.Video.ReceivedFecPacketsInPercent"));
}
TEST_F(HistogramTest, VerifyStatsWithRtx) {