diff --git a/pc/BUILD.gn b/pc/BUILD.gn index 2da600e974..5c251c5c32 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -2137,6 +2137,8 @@ if (rtc_include_tests && !build_with_chromium) { "../api/audio_codecs:audio_codecs_api", "../api/audio_codecs:builtin_audio_decoder_factory", "../api/audio_codecs:builtin_audio_encoder_factory", + "../api/test/metrics:global_metrics_logger_and_exporter", + "../api/test/metrics:metric", "../api/video_codecs:builtin_video_decoder_factory", "../api/video_codecs:builtin_video_encoder_factory", "../api/video_codecs:video_codecs_api", @@ -2154,7 +2156,6 @@ if (rtc_include_tests && !build_with_chromium) { "../rtc_base:task_queue_for_test", "../rtc_base:threading", "../system_wrappers", - "../test:perf_test", "../test:test_support", ] absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] diff --git a/pc/peer_connection_rampup_tests.cc b/pc/peer_connection_rampup_tests.cc index 3e39ffc0ae..47f463e968 100644 --- a/pc/peer_connection_rampup_tests.cc +++ b/pc/peer_connection_rampup_tests.cc @@ -27,6 +27,8 @@ #include "api/stats/rtc_stats.h" #include "api/stats/rtc_stats_report.h" #include "api/stats/rtcstats_objects.h" +#include "api/test/metrics/global_metrics_logger_and_exporter.h" +#include "api/test/metrics/metric.h" #include "api/video_codecs/builtin_video_decoder_factory.h" #include "api/video_codecs/builtin_video_encoder_factory.h" #include "modules/audio_device/include/audio_device.h" @@ -54,11 +56,14 @@ #include "rtc_base/virtual_socket_server.h" #include "system_wrappers/include/clock.h" #include "test/gtest.h" -#include "test/testsupport/perf_test.h" namespace webrtc { - namespace { + +using ::webrtc::test::GetGlobalMetricsLogger; +using ::webrtc::test::ImprovementDirection; +using ::webrtc::test::Unit; + static const int kDefaultTestTimeMs = 15000; static const int kRampUpTimeMs = 5000; static const int kPollIntervalTimeMs = 50; @@ -72,6 +77,7 @@ static const int kTurnExternalPort = 0; // Setting the network bandwidth to 1 Mbps allows the video's bitrate to push // the network's limitations. static const int kNetworkBandwidth = 1000000; + } // namespace using RTCConfiguration = PeerConnectionInterface::RTCConfiguration; @@ -265,8 +271,10 @@ class PeerConnectionRampUpTest : public ::testing::Test { double average_bandwidth_estimate = total_bwe / number_of_polls; std::string value_description = "bwe_after_" + std::to_string(kDefaultTestTimeMs / 1000) + "_seconds"; - test::PrintResult("peerconnection_ramp_up_", test_string, value_description, - average_bandwidth_estimate, "bwe", false); + GetGlobalMetricsLogger()->LogSingleValueMetric( + "peerconnection_ramp_up_" + test_string, value_description, + average_bandwidth_estimate, Unit::kUnitless, + ImprovementDirection::kNeitherIsBetter); } rtc::Thread* network_thread() { return network_thread_.get(); }