如要在本機執行效能測試,主要方法是執行主機端的進入點。這些進入點定義於 src/tests/end_to_end/perf/。這些是 Fuchsia 基礎架構建構作業中使用的項目,可收集效能結果並上傳至 Chromeperf。執行其中一個進入點時,需要完成下列步驟:
使用
terminal產品,以便與 CI 和 CQ 中的 Fuchsia Infra 測試內容相符。範例:fx set terminal.x64-reduced-perf-variation --with //bundles/buildbot/terminal fx build在硬體或模擬器上啟動 Fuchsia,與平常一樣。
使用
fx test --e2e執行測試的主機端進入點。範例:fx test --e2e --outdir="out/test_out" --timestamp-artifacts fidlc_microbenchmarks_testfx test的引數應為在呼叫fuchsia_component_perf_test範本時指定的 GN 目標名稱。
測試會將結果寫入 out/test_out 的新建立子目錄,並加上時間戳記。其中包含含有成效結果的 *.fuchsiaperf.json 檔案。可能包含其他檔案,例如 Fuchsia 追蹤記錄。
如要產生及比較本機變更前後的效能測試結果,請改用 perfcompare 工具。