自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
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 和/或其关联公司的注册商标。
最后更新时间 (UTC):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"]],["最后更新时间 (UTC):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 |"]]