Include 'debug.hypervisor.metrics_tag' in metric names
Vendor code can set a property to tag performance metric names. This can
be useful if devices in the lab have varying performance
characteristics.
Test: atest -p packages/modules/Virtualization:avf-postsubmit
Change-Id: I46478471571639a145079cdc296b9824f1328fc3
diff --git a/tests/hostside/helper/Android.bp b/tests/hostside/helper/Android.bp
index af88bb6..b2333ab 100644
--- a/tests/hostside/helper/Android.bp
+++ b/tests/hostside/helper/Android.bp
@@ -11,6 +11,7 @@
"truth-prebuilt",
],
static_libs: [
+ "MicrodroidTestHelper",
"VirtualizationTestHelper",
],
}
diff --git a/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java b/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java
index 875d89f..0417123 100644
--- a/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java
+++ b/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java
@@ -27,6 +27,7 @@
import static org.junit.Assume.assumeTrue;
import com.android.compatibility.common.tradefed.build.CompatibilityBuildHelper;
+import com.android.microdroid.test.common.MetricsProcessor;
import com.android.tradefed.build.IBuildInfo;
import com.android.tradefed.device.DeviceNotAvailableException;
import com.android.tradefed.device.ITestDevice;
@@ -97,6 +98,11 @@
return VirtualizationTestHelper.isCuttlefish(getDevice().getProperty("ro.product.name"));
}
+ protected String getMetricPrefix() throws Exception {
+ return MetricsProcessor.getMetricPrefix(
+ getDevice().getProperty("debug.hypervisor.metrics_tag"));
+ }
+
public static void testIfDeviceIsCapable(ITestDevice androidDevice) throws Exception {
assumeTrue("Need an actual TestDevice", androidDevice instanceof TestDevice);
TestDevice testDevice = (TestDevice) androidDevice;