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

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

Issue 2577183002: Add UMA for the number of devices in the chooser when a device is paired (Closed)
Patch Set: address comments Created 4 years 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
Index: content/browser/bluetooth/bluetooth_metrics.cc
diff --git a/content/browser/bluetooth/bluetooth_metrics.cc b/content/browser/bluetooth/bluetooth_metrics.cc
index 7a0b4722f7dd4bb77a30d4ca8497935cb0690ba4..6ae97006a59a33d63af9d0f41dae3967840639ef 100644
--- a/content/browser/bluetooth/bluetooth_metrics.cc
+++ b/content/browser/bluetooth/bluetooth_metrics.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include <algorithm>
#include <map>
#include <set>
#include <unordered_set>
@@ -42,6 +43,9 @@ int HashUUID(const base::Optional<BluetoothUUID>& uuid) {
return uuid ? HashUUID(uuid->canonical_value()) : 0;
}
+// The maximum number of devices that needs to be recorded.
+const size_t kMaxNumOfDevices = 100;
+
} // namespace
namespace content {
@@ -353,4 +357,13 @@ void RecordRSSISignalStrengthLevel(UMARSSISignalStrengthLevel level) {
static_cast<int>(UMARSSISignalStrengthLevel::COUNT));
}
+void RecordNumOfDevices(bool accept_all_devices, size_t num_of_devices) {
+ if (accept_all_devices) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
+ "Bluetooth.Web.RequestDevice."
+ "NumOfDevicesInChooserWhenNotAcceptingAllDevices",
+ std::min(num_of_devices, kMaxNumOfDevices));
+ }
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698