Commit c6c9e18b authored by Regan Hsu's avatar Regan Hsu Committed by Commit Bot

[CrOS MultiDevice] Create metrics for Verify and Forget Host

confirmation buttons.

MultiDevice.VerifyButtonClicked
MultiDevice.ForgetHostConfirmed

Gauge if users are getting stuck in bad states or do not like our
feature by logging when the Verify button or Forget Host confirmation
buttons are pressed. Simply logging the count of these events isn't
useful because there is no baseline; therefore, each of these should
use the following buckets:

0) Button clicked.
1) Completed Setup.

Bug: 903458
Change-Id: I1ad8e6a16a920b4dffdbcc70300bff354ef6f359
Reviewed-on: https://chromium-review.googlesource.com/c/1330294Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607743}
parent 1e711c42
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "chromeos/services/multidevice_setup/multidevice_setup_impl.h" #include "chromeos/services/multidevice_setup/multidevice_setup_impl.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "base/time/default_clock.h" #include "base/time/default_clock.h"
#include "chromeos/components/proximity_auth/logging/logging.h" #include "chromeos/components/proximity_auth/logging/logging.h"
...@@ -29,6 +30,25 @@ namespace multidevice_setup { ...@@ -29,6 +30,25 @@ namespace multidevice_setup {
namespace { namespace {
const char kTestDeviceNameForDebugNotification[] = "Test Device"; const char kTestDeviceNameForDebugNotification[] = "Test Device";
// This enum is tied directly to a UMA enum defined in
// //tools/metrics/histograms/enums.xml, and should always reflect it (do not
// change one without changing the other). Entries should be never modified
// or deleted. Only additions possible.
enum class VerifyAndForgetHostConfirmationState {
kButtonClickedState = 0,
kCompletedSetupState = 1,
kMaxValue = kCompletedSetupState,
};
static void LogForgetHostConfirmed(VerifyAndForgetHostConfirmationState state) {
UMA_HISTOGRAM_ENUMERATION("MultiDevice.ForgetHostConfirmed", state);
}
static void LogVerifyButtonClicked(VerifyAndForgetHostConfirmationState state) {
UMA_HISTOGRAM_ENUMERATION("MultiDevice.VerifyButtonClicked", state);
}
} // namespace } // namespace
// static // static
...@@ -187,6 +207,9 @@ void MultiDeviceSetupImpl::SetHostDevice(const std::string& host_device_id, ...@@ -187,6 +207,9 @@ void MultiDeviceSetupImpl::SetHostDevice(const std::string& host_device_id,
} }
void MultiDeviceSetupImpl::RemoveHostDevice() { void MultiDeviceSetupImpl::RemoveHostDevice() {
LogForgetHostConfirmed(
VerifyAndForgetHostConfirmationState::kButtonClickedState);
host_backend_delegate_->AttemptToSetMultiDeviceHostOnBackend( host_backend_delegate_->AttemptToSetMultiDeviceHostOnBackend(
base::nullopt /* host_device */); base::nullopt /* host_device */);
} }
...@@ -227,6 +250,9 @@ void MultiDeviceSetupImpl::GetFeatureStates(GetFeatureStatesCallback callback) { ...@@ -227,6 +250,9 @@ void MultiDeviceSetupImpl::GetFeatureStates(GetFeatureStatesCallback callback) {
} }
void MultiDeviceSetupImpl::RetrySetHostNow(RetrySetHostNowCallback callback) { void MultiDeviceSetupImpl::RetrySetHostNow(RetrySetHostNowCallback callback) {
LogVerifyButtonClicked(
VerifyAndForgetHostConfirmationState::kButtonClickedState);
HostStatusProvider::HostStatusWithDevice host_status_with_device = HostStatusProvider::HostStatusWithDevice host_status_with_device =
host_status_provider_->GetHostWithStatus(); host_status_provider_->GetHostWithStatus();
...@@ -328,6 +354,12 @@ bool MultiDeviceSetupImpl::AttemptSetHost(const std::string& host_device_id) { ...@@ -328,6 +354,12 @@ bool MultiDeviceSetupImpl::AttemptSetHost(const std::string& host_device_id) {
if (it == eligible_devices.end()) if (it == eligible_devices.end())
return false; return false;
LogForgetHostConfirmed(
VerifyAndForgetHostConfirmationState::kCompletedSetupState);
LogVerifyButtonClicked(
VerifyAndForgetHostConfirmationState::kCompletedSetupState);
host_backend_delegate_->AttemptToSetMultiDeviceHostOnBackend(*it); host_backend_delegate_->AttemptToSetMultiDeviceHostOnBackend(*it);
return true; return true;
......
...@@ -34006,6 +34006,11 @@ Called by update_use_counter_css.py.--> ...@@ -34006,6 +34006,11 @@ Called by update_use_counter_css.py.-->
<int value="4" label="Host verified"/> <int value="4" label="Host verified"/>
</enum> </enum>
<enum name="MultiDevice_VerifyAndForgetHostConfirmationState">
<int value="0" label="Button clicked"/>
<int value="1" label="Completed Setup"/>
</enum>
<enum name="MultiDeviceSetupNotification"> <enum name="MultiDeviceSetupNotification">
<int value="0" label="New user, potential host exists"/> <int value="0" label="New user, potential host exists"/>
<int value="1" label="Existing user, host switched"/> <int value="1" label="Existing user, host switched"/>
...@@ -51692,6 +51692,14 @@ uploading your change for review. ...@@ -51692,6 +51692,14 @@ uploading your change for review.
</summary> </summary>
</histogram> </histogram>
<histogram name="MultiDevice.ForgetHostConfirmed"
enum="MultiDevice_VerifyAndForgetHostConfirmationState">
<owner>hansberry@chromium.org</owner>
<summary>
Compares when the Forget Host Button is pressed and when setup completes.
</summary>
</histogram>
<histogram name="MultiDevice.PostOOBESetupFlow.PageShown" <histogram name="MultiDevice.PostOOBESetupFlow.PageShown"
enum="MultiDevice_PostOOBESetupFlow_Page"> enum="MultiDevice_PostOOBESetupFlow_Page">
<owner>hansberry@chromium.org</owner> <owner>hansberry@chromium.org</owner>
...@@ -51732,6 +51740,14 @@ uploading your change for review. ...@@ -51732,6 +51740,14 @@ uploading your change for review.
</summary> </summary>
</histogram> </histogram>
<histogram name="MultiDevice.VerifyButtonClicked"
enum="MultiDevice_VerifyAndForgetHostConfirmationState">
<owner>hansberry@chromium.org</owner>
<summary>
Compares when the Verify Host Button is pressed to when setup completes.
</summary>
</histogram>
<histogram name="MultiDeviceSetup.OOBE.UserChoice" <histogram name="MultiDeviceSetup.OOBE.UserChoice"
enum="MultiDeviceSetupOOBEUserChoice"> enum="MultiDeviceSetupOOBEUserChoice">
<owner>hansberry@chromium.org</owner> <owner>hansberry@chromium.org</owner>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment