Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(795)

Unified Diff: content/browser/bluetooth/bluetooth_metrics.cc

Issue 1294473006: bluetooth: Add histograms for readValue and writeValue outcomes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-uma-get-characteristic
Patch Set: Fix typos Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/bluetooth/bluetooth_metrics.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bluetooth/bluetooth_metrics.cc
diff --git a/content/browser/bluetooth/bluetooth_metrics.cc b/content/browser/bluetooth/bluetooth_metrics.cc
index 345816706d2f94b76cb9a4db30d703568fe58a11..e04a7cab0ea54ac3730cd60be9c1541c3e148412 100644
--- a/content/browser/bluetooth/bluetooth_metrics.cc
+++ b/content/browser/bluetooth/bluetooth_metrics.cc
@@ -139,11 +139,39 @@ void RecordGetCharacteristicCharacteristic(const std::string& characteristic) {
HashUUID(characteristic));
}
-// read/write characteristic
+// GATT Operations
+
+void RecordGATTOperationOutcome(UMAGATTOperation operation,
+ UMAGATTOperationOutcome outcome) {
+ switch (operation) {
+ case UMAGATTOperation::CHARACTERISTIC_READ:
+ RecordCharacteristicReadValueOutcome(outcome);
+ return;
+ case UMAGATTOperation::CHARACTERISTIC_WRITE:
+ RecordCharacteristicWriteValueOutcome(outcome);
+ return;
+ case UMAGATTOperation::COUNT:
+ NOTREACHED();
+ return;
+ }
+ NOTREACHED();
+}
+
+// Characteristic.readValue
+
+// static
+void RecordCharacteristicReadValueOutcome(UMAGATTOperationOutcome outcome) {
+ UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Characteristic.ReadValue.Outcome",
+ static_cast<int>(outcome),
+ static_cast<int>(UMAGATTOperationOutcome::COUNT));
+}
-void RecordGATTError(UMAGATTError error) {
- UMA_HISTOGRAM_ENUMERATION("Bluetooth.GATTErrors", static_cast<int>(error),
- static_cast<int>(UMAGATTError::MAX_ERROR));
+// Characteristic.writeValue
+
+void RecordCharacteristicWriteValueOutcome(UMAGATTOperationOutcome outcome) {
+ UMA_HISTOGRAM_ENUMERATION("Bluetooth.Web.Characteristic.WriteValue.Outcome",
+ static_cast<int>(outcome),
+ static_cast<int>(UMAGATTOperationOutcome::COUNT));
}
} // namespace content
« no previous file with comments | « content/browser/bluetooth/bluetooth_metrics.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698