Migrate audio perf tests on new perf metrics export API
Bug: b/246095034 Change-Id: Id659e43c116428cab47d334c93a6036f74dbb8e1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276626 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Ivo Creusen <ivoc@webrtc.org> Commit-Queue: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38192}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
cc6aae7a4c
commit
e39115a0ca
@ -8,10 +8,18 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "api/test/metrics/global_metrics_logger_and_exporter.h"
|
||||
#include "api/test/metrics/metric.h"
|
||||
#include "modules/audio_coding/neteq/tools/neteq_performance_test.h"
|
||||
#include "system_wrappers/include/field_trial.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;
|
||||
|
||||
// Runs a test with 10% packet losses and 10% clock drift, to exercise
|
||||
// both loss concealment and time-stretching code.
|
||||
@ -20,14 +28,14 @@ TEST(NetEqPerformanceTest, 10_Pl_10_Drift) {
|
||||
const int kQuickSimulationTimeMs = 100000;
|
||||
const int kLossPeriod = 10; // Drop every 10th packet.
|
||||
const double kDriftFactor = 0.1;
|
||||
int64_t runtime = webrtc::test::NetEqPerformanceTest::Run(
|
||||
webrtc::field_trial::IsEnabled("WebRTC-QuickPerfTest")
|
||||
? kQuickSimulationTimeMs
|
||||
: kSimulationTimeMs,
|
||||
int64_t runtime = test::NetEqPerformanceTest::Run(
|
||||
field_trial::IsEnabled("WebRTC-QuickPerfTest") ? kQuickSimulationTimeMs
|
||||
: kSimulationTimeMs,
|
||||
kLossPeriod, kDriftFactor);
|
||||
ASSERT_GT(runtime, 0);
|
||||
webrtc::test::PrintResult("neteq_performance", "", "10_pl_10_drift", runtime,
|
||||
"ms", true);
|
||||
GetGlobalMetricsLogger()->LogSingleValueMetric(
|
||||
"neteq_performance", "10_pl_10_drift", runtime, Unit::kMilliseconds,
|
||||
ImprovementDirection::kNeitherIsBetter);
|
||||
}
|
||||
|
||||
// Runs a test with neither packet losses nor clock drift, to put
|
||||
@ -38,12 +46,15 @@ TEST(NetEqPerformanceTest, 0_Pl_0_Drift) {
|
||||
const int kQuickSimulationTimeMs = 100000;
|
||||
const int kLossPeriod = 0; // No losses.
|
||||
const double kDriftFactor = 0.0; // No clock drift.
|
||||
int64_t runtime = webrtc::test::NetEqPerformanceTest::Run(
|
||||
webrtc::field_trial::IsEnabled("WebRTC-QuickPerfTest")
|
||||
? kQuickSimulationTimeMs
|
||||
: kSimulationTimeMs,
|
||||
int64_t runtime = test::NetEqPerformanceTest::Run(
|
||||
field_trial::IsEnabled("WebRTC-QuickPerfTest") ? kQuickSimulationTimeMs
|
||||
: kSimulationTimeMs,
|
||||
kLossPeriod, kDriftFactor);
|
||||
ASSERT_GT(runtime, 0);
|
||||
webrtc::test::PrintResult("neteq_performance", "", "0_pl_0_drift", runtime,
|
||||
"ms", true);
|
||||
GetGlobalMetricsLogger()->LogSingleValueMetric(
|
||||
"neteq_performance", "0_pl_0_drift", runtime, Unit::kMilliseconds,
|
||||
ImprovementDirection::kNeitherIsBetter);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user