| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ | 5 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ |
| 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ | 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ |
| 7 | 7 |
| 8 #include <string> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 namespace base { | 11 namespace base { |
| 11 class TimeDelta; | 12 class TimeDelta; |
| 12 } | 13 } |
| 13 | 14 |
| 14 namespace device { | 15 namespace device { |
| 15 class BluetoothUUID; | 16 class BluetoothUUID; |
| 16 } | 17 } |
| 17 | 18 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // tools/metrics/histograms/histograms.xml accordingly. | 105 // tools/metrics/histograms/histograms.xml accordingly. |
| 105 COUNT | 106 COUNT |
| 106 }; | 107 }; |
| 107 // Record the service uuid used when calling getPrimaryService. | 108 // Record the service uuid used when calling getPrimaryService. |
| 108 void RecordGetPrimaryServiceService(const device::BluetoothUUID& service); | 109 void RecordGetPrimaryServiceService(const device::BluetoothUUID& service); |
| 109 // There should be a call to this function for every call to | 110 // There should be a call to this function for every call to |
| 110 // Send(BluetoothMsg_GetPrimaryServiceSuccess) and | 111 // Send(BluetoothMsg_GetPrimaryServiceSuccess) and |
| 111 // Send(BluetoothMsg_GetPrimaryServiceError). | 112 // Send(BluetoothMsg_GetPrimaryServiceError). |
| 112 void RecordGetPrimaryServiceOutcome(UMAGetPrimaryServiceOutcome outcome); | 113 void RecordGetPrimaryServiceOutcome(UMAGetPrimaryServiceOutcome outcome); |
| 113 | 114 |
| 115 // getCharacteristic() Metrics |
| 116 enum class UMAGetCharacteristicOutcome { |
| 117 SUCCESS = 0, |
| 118 NO_DEVICE = 1, |
| 119 NO_SERVICE = 2, |
| 120 NOT_FOUND = 3, |
| 121 // Note: Add new outcomes immediately above this line. |
| 122 // Make sure to update the enum list in |
| 123 // tools/metrisc/histogram/histograms.xml accordingly. |
| 124 COUNT |
| 125 }; |
| 126 // There should be a call to this function for every call to |
| 127 // Send(BluetoothMsg_GetCharacteristicSuccess) and |
| 128 // Send(BluetoothMsg_GetCharacteristicError). |
| 129 void RecordGetCharacteristicOutcome(UMAGetCharacteristicOutcome outcome); |
| 130 // Records the UUID of the characteristic used when calling getCharacteristic. |
| 131 void RecordGetCharacteristicCharacteristic(const std::string& characteristic); |
| 132 |
| 114 // read/write characteristics Metrics | 133 // read/write characteristics Metrics |
| 115 // TODO(ortuno): For now we are just copying over the code to record these | 134 // TODO(ortuno): For now we are just copying over the code to record these |
| 116 // errors but a follow up CL will add a function for each operation. | 135 // errors but a follow up CL will add a function for each operation. |
| 117 | 136 |
| 118 // These types of errors aren't as common. We log them to understand | 137 // These types of errors aren't as common. We log them to understand |
| 119 // how common they are and if we need to investigate more. | 138 // how common they are and if we need to investigate more. |
| 120 enum class UMAGATTError { | 139 enum class UMAGATTError { |
| 121 UNKNOWN = 0, | 140 UNKNOWN = 0, |
| 122 FAILED = 1, | 141 FAILED = 1, |
| 123 IN_PROGRESS = 2, | 142 IN_PROGRESS = 2, |
| 124 NOT_PAIRED = 3, | 143 NOT_PAIRED = 3, |
| 125 // Note: Add new GATT Errors immediately above this line. | 144 // Note: Add new GATT Errors immediately above this line. |
| 126 // Make sure to update the enum list in | 145 // Make sure to update the enum list in |
| 127 // tools/metrics/histograms/histograms.xml accordingly. | 146 // tools/metrics/histograms/histograms.xml accordingly. |
| 128 MAX_ERROR, | 147 MAX_ERROR, |
| 129 }; | 148 }; |
| 130 // Records the GATT Error the function returned. | 149 // Records the GATT Error the function returned. |
| 131 void RecordGATTError(UMAGATTError error); | 150 void RecordGATTError(UMAGATTError error); |
| 132 | 151 |
| 133 } // namespace content | 152 } // namespace content |
| 134 | 153 |
| 135 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ | 154 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_METRICS_H_ |
| OLD | NEW |