Migrate PeerConnectionRampUpTest on new perf metrics export API
Bug: b/246095034 Change-Id: I3133f6f7517cc303eeec2e860614e91b2ce4402b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276630 Commit-Queue: Artem Titov <titovartem@webrtc.org> Reviewed-by: Per Kjellander <perkj@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Per Åhgren <peah@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38207}
This commit is contained in:
parent
183e9968ce
commit
2ae3f7bb60
@ -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" ]
|
||||
|
||||
@ -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(); }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user