give mugshot tests their own LogDataType
this is intended to allow mugshot results to integrate with ATMetrics
Bug: 62357119
Test: run asit/ota/performance/uncrypt-io
Change-Id: Ia8dc2e143556075719664744df1ce70083ab5913
diff --git a/proto/file_metadata.proto b/proto/file_metadata.proto
index 8edf0bd..cf82d42 100644
--- a/proto/file_metadata.proto
+++ b/proto/file_metadata.proto
@@ -21,6 +21,8 @@
PROCRANK=10;
SERVICES=11;
TOP=12;
+ // skip item 13 ERRORSTATS
+ MUGSHOT=14;
}
// Represents a single log file
diff --git a/src/com/android/tradefed/profiler/AggregatingProfiler.java b/src/com/android/tradefed/profiler/AggregatingProfiler.java
index b24f87e..52865bc 100644
--- a/src/com/android/tradefed/profiler/AggregatingProfiler.java
+++ b/src/com/android/tradefed/profiler/AggregatingProfiler.java
@@ -114,7 +114,8 @@
@Override
public void reportAllMetrics(ITestInvocationListener listener) {
mOutputUtil.addMetrics("aggregate", mContext.getTestTag(), mAggregateMetrics);
- listener.testLog(getDescription(), LogDataType.TEXT, mOutputUtil.getFormattedMetrics());
+ listener.testLog(getDescription(), LogDataType.MUGSHOT_LOG,
+ mOutputUtil.getFormattedMetrics());
}
/**
diff --git a/src/com/android/tradefed/result/FileMetadataCollector.java b/src/com/android/tradefed/result/FileMetadataCollector.java
index 28f8fff..15905cf 100644
--- a/src/com/android/tradefed/result/FileMetadataCollector.java
+++ b/src/com/android/tradefed/result/FileMetadataCollector.java
@@ -110,6 +110,8 @@
return LogType.COMPACT_MEMINFO;
case SERVICES:
return LogType.SERVICES;
+ case MUGSHOT_LOG:
+ return LogType.MUGSHOT;
default: // All others
return LogType.UNKNOWN;
}
diff --git a/src/com/android/tradefed/result/LogDataType.java b/src/com/android/tradefed/result/LogDataType.java
index ee19af4..58d79f0 100644
--- a/src/com/android/tradefed/result/LogDataType.java
+++ b/src/com/android/tradefed/result/LogDataType.java
@@ -37,6 +37,7 @@
LOGCAT("txt", "text/plain", false, true),
KERNEL_LOG("txt", "text/plain", false, true),
MONKEY_LOG("txt", "text/plain", false, true),
+ MUGSHOT_LOG("txt", "text/plain", false, true),
PROCRANK("txt", "text/plain", false, true),
MEM_INFO("txt", "text/plain", false, true),
TOP("txt", "text/plain", false, true),
diff --git a/tests/src/com/android/tradefed/profiler/AggregatingProfilerTest.java b/tests/src/com/android/tradefed/profiler/AggregatingProfilerTest.java
index e3bad75..596ce32 100644
--- a/tests/src/com/android/tradefed/profiler/AggregatingProfilerTest.java
+++ b/tests/src/com/android/tradefed/profiler/AggregatingProfilerTest.java
@@ -162,7 +162,7 @@
metric1.put("hello1", 1.0);
mProfiler.setAggregateMetrics(metric1);
ITestInvocationListener mockListener = EasyMock.createMock(ITestInvocationListener.class);
- mockListener.testLog((String)EasyMock.anyObject(), EasyMock.eq(LogDataType.TEXT),
+ mockListener.testLog((String)EasyMock.anyObject(), EasyMock.eq(LogDataType.MUGSHOT_LOG),
(InputStreamSource)EasyMock.anyObject());
EasyMock.replay(mockListener);
mProfiler.reportAllMetrics(mockListener);