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 #include "content/browser/bluetooth/bluetooth_metrics.h" | 5 #include "content/browser/bluetooth/bluetooth_metrics.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include "base/hash.h" | 9 #include "base/hash.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 void RecordGATTOperationOutcome(UMAGATTOperation operation, | 144 void RecordGATTOperationOutcome(UMAGATTOperation operation, |
145 UMAGATTOperationOutcome outcome) { | 145 UMAGATTOperationOutcome outcome) { |
146 switch (operation) { | 146 switch (operation) { |
147 case UMAGATTOperation::CHARACTERISTIC_READ: | 147 case UMAGATTOperation::CHARACTERISTIC_READ: |
148 RecordCharacteristicReadValueOutcome(outcome); | 148 RecordCharacteristicReadValueOutcome(outcome); |
149 return; | 149 return; |
150 case UMAGATTOperation::CHARACTERISTIC_WRITE: | 150 case UMAGATTOperation::CHARACTERISTIC_WRITE: |
151 RecordCharacteristicWriteValueOutcome(outcome); | 151 RecordCharacteristicWriteValueOutcome(outcome); |
152 return; | 152 return; |
| 153 case UMAGATTOperation::START_NOTIFICATIONS: |
| 154 RecordStartNotificationsOutcome(outcome); |
| 155 return; |
153 case UMAGATTOperation::COUNT: | 156 case UMAGATTOperation::COUNT: |
154 NOTREACHED(); | 157 NOTREACHED(); |
155 return; | 158 return; |
156 } | 159 } |
157 NOTREACHED(); | 160 NOTREACHED(); |
158 } | 161 } |
159 | 162 |
160 // Characteristic.readValue | 163 // Characteristic.readValue |
161 | 164 |
162 // static | 165 // static |
163 void RecordCharacteristicReadValueOutcome(UMAGATTOperationOutcome outcome) { | 166 void RecordCharacteristicReadValueOutcome(UMAGATTOperationOutcome outcome) { |
164 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Characteristic.ReadValue.Outcome", | 167 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Characteristic.ReadValue.Outcome", |
165 static_cast<int>(outcome), | 168 static_cast<int>(outcome), |
166 static_cast<int>(UMAGATTOperationOutcome::COUNT)); | 169 static_cast<int>(UMAGATTOperationOutcome::COUNT)); |
167 } | 170 } |
168 | 171 |
169 // Characteristic.writeValue | 172 // Characteristic.writeValue |
170 | 173 |
171 void RecordCharacteristicWriteValueOutcome(UMAGATTOperationOutcome outcome) { | 174 void RecordCharacteristicWriteValueOutcome(UMAGATTOperationOutcome outcome) { |
172 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Characteristic.WriteValue.Outcome", | 175 UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Characteristic.WriteValue.Outcome", |
173 static_cast<int>(outcome), | 176 static_cast<int>(outcome), |
174 static_cast<int>(UMAGATTOperationOutcome::COUNT)); | 177 static_cast<int>(UMAGATTOperationOutcome::COUNT)); |
175 } | 178 } |
176 | 179 |
| 180 // Characteristic.startNotifications |
| 181 void RecordStartNotificationsOutcome(UMAGATTOperationOutcome outcome) { |
| 182 UMA_HISTOGRAM_ENUMERATION( |
| 183 "Bluetooth.Web.Characteristic.StartNotifications.Outcome", |
| 184 static_cast<int>(outcome), |
| 185 static_cast<int>(UMAGATTOperationOutcome::COUNT)); |
| 186 } |
| 187 |
177 } // namespace content | 188 } // namespace content |
OLD | NEW |