自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
BluetoothConnectionLatencyCollector
public
class
BluetoothConnectionLatencyCollector
extends HostStatsdMetricCollector
收集器會將預先定義的 statsd 持續時間指標設定推送至裝置,並收集每個設定檔的藍牙連線時間。
摘要
欄位
BLUETOOTH_PROFILES_MAP
protected static final ImmutableMap<Integer, String> BLUETOOTH_PROFILES_MAP
對應項目會將藍牙設定檔編號與用於指標鍵的描述性名稱建立關聯。
公用建構函式
BluetoothConnectionLatencyCollector
public BluetoothConnectionLatencyCollector ()
受保護的方法
protected void processStatsReport (ITestDevice device,
InputStreamSource dataStream,
DeviceMetricData runData)
子類別可在必要時實作方法,以便處理 Statsd 指標報表。會針對特定裝置的評估指標報表呼叫
參數 |
device |
ITestDevice :測試 statsd 回報來源的裝置 |
dataStream |
InputStreamSource :統計資料報告做為輸入串流 |
runData |
DeviceMetricData :要儲存經過處理的指標的目的 |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","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-07-27 (世界標準時間)。"],[],[],null,["# BluetoothConnectionLatencyCollector\n===================================\n\n\n`\npublic\n\n\nclass\nBluetoothConnectionLatencyCollector\n`\n\n\n`\n\n\n`\n\n`\n\n\n`\n\n`\n\nextends `[HostStatsdMetricCollector](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/HostStatsdMetricCollector.html)`\n\n\n`\n\n`\n\n\n`\n\n|---|---|---|------------------------------------------------------------------------|\n| java.lang.Object ||||\n| ↳ | [com.android.tradefed.device.metric.BaseDeviceMetricCollector](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/BaseDeviceMetricCollector.html) |||\n| | ↳ | [com.android.tradefed.device.metric.HostStatsdMetricCollector](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/HostStatsdMetricCollector.html) ||\n| | | ↳ | com.android.tradefed.device.metric.BluetoothConnectionLatencyCollector |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known direct subclasses [BluetoothConnectionStateCollector](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/BluetoothConnectionStateCollector.html) |--------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------| | [BluetoothConnectionStateCollector](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/BluetoothConnectionStateCollector.html) | This collector will collect BluetoothConnectionStateChanged metrics and record connection state number for each profile. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe collector will push a pre-defined statsd duration metric config to devices and collect\nBluetooth connection duration for each profile.\n\nSummary\n-------\n\n| ### Fields ||\n|---------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` protected static final ImmutableMap\u003cInteger, String\u003e` | [BLUETOOTH_PROFILES_MAP](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/BluetoothConnectionLatencyCollector.html#BLUETOOTH_PROFILES_MAP) A map associates Bluetooth profile number to the descriptive name used for metric key. |\n\n| ### Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[BluetoothConnectionLatencyCollector](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/BluetoothConnectionLatencyCollector.html#BluetoothConnectionLatencyCollector())`() ` |\n\n| ### Protected methods ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[processStatsReport](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/BluetoothConnectionLatencyCollector.html#processStatsReport(com.android.tradefed.device.ITestDevice,%20com.android.tradefed.result.InputStreamSource,%20com.android.tradefed.device.metric.DeviceMetricData))`(`[ITestDevice](../../../../../../../reference/tradefed/com/android/tradefed/device/ITestDevice.html)` device, `[InputStreamSource](../../../../../../../reference/tradefed/com/android/tradefed/result/InputStreamSource.html)` dataStream, `[DeviceMetricData](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/DeviceMetricData.html)` runData) ` Subclasses can implement the method to process Statsd metric report if needed. |\n\nFields\n------\n\n### BLUETOOTH_PROFILES_MAP\n\n```\nprotected static final ImmutableMap\u003cInteger, String\u003e BLUETOOTH_PROFILES_MAP\n```\n\nA map associates Bluetooth profile number to the descriptive name used for metric key.\n\n\u003cbr /\u003e\n\nPublic constructors\n-------------------\n\n### BluetoothConnectionLatencyCollector\n\n```\npublic BluetoothConnectionLatencyCollector ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nProtected methods\n-----------------\n\n### processStatsReport\n\n```\nprotected void processStatsReport (ITestDevice device, \n InputStreamSource dataStream, \n DeviceMetricData runData)\n```\n\nSubclasses can implement the method to process Statsd metric report if needed. It is called\nfor metric report from a particular device\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------|---------------------------------------------------------------------------------------|\n| `device` | `ITestDevice`: Test device where the statsd report is coming from \u003cbr /\u003e |\n| `dataStream` | `InputStreamSource`: Stats report as input stream \u003cbr /\u003e |\n| `runData` | `DeviceMetricData`: The destination where the processed metrics will be stored \u003cbr /\u003e |"]]