自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
PerfettoPullerMetricCollector
public
class
PerfettoPullerMetricCollector
extends FilePullerDeviceMetricCollector
FilePullerDeviceMetricCollector
的基本實作項目,可從裝置中提取 Perfetto 檔案,並收集相關指標。也可用於將原始追蹤記錄檔轉換為 Perfetto 指標檔案。
摘要
公用建構函式
PerfettoPullerMetricCollector
public PerfettoPullerMetricCollector ()
公用方法
processMetricDirectory
public void processMetricDirectory (String key,
File metricDirectory,
DeviceMetricData runData)
方法的實作方式應允許記錄目錄,並剖析該目錄,以便將指標放入 DeviceMetricData
。
processMetricFile
public void processMetricFile (String key,
File metricFile,
DeviceMetricData data)
處理其他指標的 Perfetto 追蹤記錄檔,然後將其新增至最終指標。如果已啟用壓縮功能,請解壓縮 Perfetto 檔案以便處理。
參數 |
key |
String :與從裝置提取的檔案相關聯的選項鍵。 |
metricFile |
File :從裝置中擷取的 ERROR(/File) ,與選項鍵相符。 |
data |
DeviceMetricData :指標儲存位置。 |
受保護的方法
retrieveFile
protected File retrieveFile (ITestDevice device,
String remoteFilePath,
int userId)
從裝置中指定的路徑提取檔案。如果啟用壓縮 Perfetto 選項,請提取 Perfetto 檔案的壓縮內容。
參數 |
device |
ITestDevice :檔案所在位置。 |
remoteFilePath |
String :裝置中的位置。 |
userId |
int :要從中提取的使用者 ID |
傳回 |
File |
根據是否已設定 mCompressPerfetto 選項,壓縮或解壓縮的 Perfeto 檔案。 |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-03-26 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-03-26 (世界標準時間)。"],[],[]]