Migrate video_send_stream_tests.cc to the new perf metrics export API

Bug: b/246095034
Change-Id: I185381205dd5233990307b872971a9397f126d2c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276631
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38195}
This commit is contained in:
Artem Titov 2022-09-25 01:25:15 +02:00 committed by WebRTC LUCI CQ
parent dd65499002
commit e05bf45198
2 changed files with 9 additions and 5 deletions

View File

@ -794,6 +794,8 @@ if (rtc_include_tests) {
"../api/rtc_event_log",
"../api/task_queue",
"../api/task_queue:default_task_queue_factory",
"../api/test/metrics:global_metrics_logger_and_exporter",
"../api/test/metrics:metric",
"../api/test/video:function_video_factory",
"../api/units:data_rate",
"../api/units:frequency",
@ -887,7 +889,6 @@ if (rtc_include_tests) {
"../test:mock_frame_transformer",
"../test:mock_transport",
"../test:null_transport",
"../test:perf_test",
"../test:rtp_test_utils",
"../test:run_loop",
"../test:scoped_key_value_config",

View File

@ -16,6 +16,8 @@
#include "api/sequence_checker.h"
#include "api/task_queue/default_task_queue_factory.h"
#include "api/task_queue/task_queue_base.h"
#include "api/test/metrics/global_metrics_logger_and_exporter.h"
#include "api/test/metrics/metric.h"
#include "api/test/simulated_network.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video/encoded_image.h"
@ -66,7 +68,6 @@
#include "test/gtest.h"
#include "test/null_transport.h"
#include "test/rtcp_packet_parser.h"
#include "test/testsupport/perf_test.h"
#include "test/video_encoder_proxy_factory.h"
#include "video/send_statistics_proxy.h"
#include "video/transport_adapter.h"
@ -1514,9 +1515,11 @@ TEST_F(VideoSendStreamTest, MinTransmitBitrateRespectsRemb) {
EXPECT_EQ(1u, stats.substreams.size());
int total_bitrate_bps =
stats.substreams.begin()->second.total_bitrate_bps;
test::PrintResult(
"bitrate_stats_", "min_transmit_bitrate_low_remb", "bitrate_bps",
static_cast<size_t>(total_bitrate_bps), "bps", false);
test::GetGlobalMetricsLogger()->LogSingleValueMetric(
"bitrate_stats_min_transmit_bitrate_low_remb", "bitrate_bps",
static_cast<size_t>(total_bitrate_bps) / 1000.0,
test::Unit::kKilobitsPerSecond,
test::ImprovementDirection::kNeitherIsBetter);
if (total_bitrate_bps > kHighBitrateBps) {
rtp_rtcp_->SetRemb(kRembBitrateBps, {ssrc});
bitrate_capped_ = true;