Commit 1f1be08c authored by Fergus Dall's avatar Fergus Dall Committed by Commit Bot

Disaggregate reporting on users canceling crostini installation

We want to know when during the installation process users are canceling

This CL adds a new bucket to the histogram for each cancelable state
of the installation process. Currently, it maps from install state to
reporting bucket by doing arithmetic on enum values. I'm not sure this
is the best way to do this, since it's vulnerable to us changing the
numbering of install states in the future. The alternative would be to
add a static map to the class from State to SetupResult.

Bug: 703927
Change-Id: I7ac2fd19b3370f2c46a7cd4bfe9be78b63f31612
Reviewed-on: https://chromium-review.googlesource.com/c/1331094Reviewed-by: default avatarNicholas Verne <nverne@chromium.org>
Commit-Queue: Fergus Dall <sidereal@google.com>
Cr-Commit-Position: refs/heads/master@{#607465}
parent 6c70a9a8
...@@ -182,7 +182,12 @@ bool CrostiniInstallerView::Cancel() { ...@@ -182,7 +182,12 @@ bool CrostiniInstallerView::Cancel() {
// being called after "this" has been destroyed. // being called after "this" has been destroyed.
crostini::CrostiniManager::GetForProfile(profile_)->AbortRestartCrostini( crostini::CrostiniManager::GetForProfile(profile_)->AbortRestartCrostini(
restart_id_); restart_id_);
RecordSetupResultHistogram(SetupResult::kUserCancelled);
SetupResult result = SetupResult::kUserCancelledStart;
result = static_cast<SetupResult>(static_cast<int>(result) +
static_cast<int>(state_) -
static_cast<int>(State::INSTALL_START));
RecordSetupResultHistogram(result);
if (do_cleanup_) { if (do_cleanup_) {
// Remove anything that got installed // Remove anything that got installed
......
...@@ -38,7 +38,10 @@ class CrostiniInstallerView ...@@ -38,7 +38,10 @@ class CrostiniInstallerView
// numeric values should never be reused. // numeric values should never be reused.
enum class SetupResult { enum class SetupResult {
kNotStarted = 0, kNotStarted = 0,
// Deprecated, use the more specific cancelled values further down
kUserCancelled = 1, kUserCancelled = 1,
kSuccess = 2, kSuccess = 2,
kErrorLoadingTermina = 3, kErrorLoadingTermina = 3,
kErrorStartingConcierge = 4, kErrorStartingConcierge = 4,
...@@ -49,6 +52,18 @@ class CrostiniInstallerView ...@@ -49,6 +52,18 @@ class CrostiniInstallerView
kErrorFetchingSshKeys = 9, kErrorFetchingSshKeys = 9,
kErrorMountingContainer = 10, kErrorMountingContainer = 10,
kErrorSettingUpContainer = 11, kErrorSettingUpContainer = 11,
kUserCancelledStart = 12,
kUserCancelledInstallImageLoader = 13,
kUserCancelledStartConcierge = 14,
kUserCancelledCreateDiskImage = 15,
kUserCancelledStartTerminaVm = 16,
kUserCancelledCreateContainer = 17,
kUserCancelledStartContainer = 18,
kUserCancelledSetupContainer = 19,
kUserCancelledFetchSshKeys = 20,
kUserCancelledMountContainer = 21,
kCount kCount
}; };
......
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