Commit 68220d0c authored by Fergus Dall's avatar Fergus Dall Committed by Commit Bot

Collect crostini installer metrics on cancel

Due to a bug in the original implementation of the metrics,
Crostini.TimeToInstallCancel and Crostini.AvailableDiskCancel were not
collected in most cancellations and could sometimes be collected in
the wrong state.

Bug: 953545
Change-Id: I9c23abdb61b2b3b8d33dec802f89035ed59d9db8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1714724
Auto-Submit: Fergus Dall <sidereal@google.com>
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680325}
parent 14560c1e
...@@ -268,13 +268,15 @@ bool CrostiniInstallerView::Accept() { ...@@ -268,13 +268,15 @@ bool CrostiniInstallerView::Accept() {
bool CrostiniInstallerView::Cancel() { bool CrostiniInstallerView::Cancel() {
if (!has_logged_timing_result_ && if (!has_logged_timing_result_ &&
restart_id_ == crostini::CrostiniManager::kUninitializedRestartId) { (restart_id_ != crostini::CrostiniManager::kUninitializedRestartId ||
state_ == State::INSTALL_START)) {
UMA_HISTOGRAM_LONG_TIMES(kCrostiniTimeToInstallCancel, UMA_HISTOGRAM_LONG_TIMES(kCrostiniTimeToInstallCancel,
base::TimeTicks::Now() - install_start_time_); base::TimeTicks::Now() - install_start_time_);
has_logged_timing_result_ = true; has_logged_timing_result_ = true;
} }
if (!has_logged_free_disk_result_ && if (!has_logged_free_disk_result_ &&
restart_id_ == crostini::CrostiniManager::kUninitializedRestartId && (restart_id_ != crostini::CrostiniManager::kUninitializedRestartId ||
state_ == State::INSTALL_START) &&
free_disk_space_ != kUninitializedDiskSpace) { free_disk_space_ != kUninitializedDiskSpace) {
base::UmaHistogramCounts1M(kCrostiniAvailableDiskCancel, base::UmaHistogramCounts1M(kCrostiniAvailableDiskCancel,
free_disk_space_ >> 20); free_disk_space_ >> 20);
......
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