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

Unified Diff: device/bluetooth/bluetooth_adapter_experimental_chromeos.cc

Issue 13872017: Bluetooth: gather usage metrics (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Further review comments Created 7 years, 8 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
Index: device/bluetooth/bluetooth_adapter_experimental_chromeos.cc
diff --git a/device/bluetooth/bluetooth_adapter_experimental_chromeos.cc b/device/bluetooth/bluetooth_adapter_experimental_chromeos.cc
index 5143dd16ef35cfd4fd779bc93cd9c6af0b0bd6e2..918786081634cf7f9e44f8dd7cbdf0b2dbf06bf6 100644
--- a/device/bluetooth/bluetooth_adapter_experimental_chromeos.cc
+++ b/device/bluetooth/bluetooth_adapter_experimental_chromeos.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/logging.h"
+#include "base/metrics/histogram.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/experimental_bluetooth_adapter_client.h"
#include "chromeos/dbus/experimental_bluetooth_device_client.h"
@@ -246,6 +247,19 @@ void BluetoothAdapterExperimentalChromeOS::DevicePropertyChanged(
property_name == properties->connected.name() ||
property_name == properties->uuids.name())
NotifyDeviceChanged(device_chromeos);
+
+ // UMA connection counting
+ if (property_name == properties->connected.name()) {
+ int count = 0;
+
+ for (DevicesMap::iterator iter = devices_.begin();
+ iter != devices_.end(); ++iter) {
+ if (iter->second->IsConnected())
+ ++count;
+ }
+
+ UMA_HISTOGRAM_COUNTS_100("Bluetooth.ConnectedDeviceCount", count);
+ }
}
BluetoothDeviceExperimentalChromeOS*

Powered by Google App Engine
This is Rietveld 408576698