summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbcwhite <bcwhite@chromium.org>2016-03-18 13:48:52 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-18 20:50:27 +0000
commitd2b8449dbe5f4383f5161ef01aeeeb1a4206b85f (patch)
tree881e7c8db81670563ec4528f128e21083ca05cbe
parenta1714ab3703201b3a3c424fa42788f0e4d060b26 (diff)
downloadchromium_src-d2b8449dbe5f4383f5161ef01aeeeb1a4206b85f.zip
chromium_src-d2b8449dbe5f4383f5161ef01aeeeb1a4206b85f.tar.gz
chromium_src-d2b8449dbe5f4383f5161ef01aeeeb1a4206b85f.tar.bz2
More setup metrics for background operation and overall result.
BUG=546019 Review URL: https://codereview.chromium.org/1802673002 Cr-Commit-Position: refs/heads/master@{#382078}
-rw-r--r--chrome/installer/setup/setup_main.cc65
-rw-r--r--chrome/installer/util/installer_state.cc5
-rw-r--r--chrome/installer/util/installer_state.h7
-rw-r--r--chrome/installer/util/util_constants.h2
-rw-r--r--tools/metrics/histograms/histograms.xml74
5 files changed, 138 insertions, 15 deletions
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index bab5bd5..7f85227 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -264,7 +264,12 @@ bool UncompressAndPatchChromeArchive(
base::TimeDelta elapsed_time = base::TimeTicks::Now() - start_time;
bool has_full_archive = base::PathExists(archive_helper->target());
- UMA_HISTOGRAM_BOOLEAN("Setup.Install.HasArchivePatch", !has_full_archive);
+ if (installer_state.is_background_mode()) {
+ UMA_HISTOGRAM_BOOLEAN("Setup.Install.HasArchivePatch.background",
+ !has_full_archive);
+ } else {
+ UMA_HISTOGRAM_BOOLEAN("Setup.Install.HasArchivePatch", !has_full_archive);
+ }
// Short-circuit if uncompression produced the uncompressed archive rather
// than a patch file.
@@ -272,13 +277,23 @@ bool UncompressAndPatchChromeArchive(
*archive_type = installer::FULL_ARCHIVE_TYPE;
// Uncompression alone hopefully takes less than 3 minutes even on slow
// machines.
- UMA_HISTOGRAM_MEDIUM_TIMES("Setup.Install.UncompressFullArchiveTime",
- elapsed_time);
+ if (installer_state.is_background_mode()) {
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "Setup.Install.UncompressFullArchiveTime.background", elapsed_time);
+ } else {
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "Setup.Install.UncompressFullArchiveTime", elapsed_time);
+ }
return true;
}
- UMA_HISTOGRAM_MEDIUM_TIMES("Setup.Install.UncompressArchivePatchTime",
- elapsed_time);
+ if (installer_state.is_background_mode()) {
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "Setup.Install.UncompressArchivePatchTime.background", elapsed_time);
+ } else {
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "Setup.Install.UncompressArchivePatchTime", elapsed_time);
+ }
// Find the installed version's archive to serve as the source for patching.
base::FilePath patch_source(installer::FindArchiveToPatch(original_state,
@@ -297,7 +312,7 @@ bool UncompressAndPatchChromeArchive(
// Try courgette first. Failing that, try bspatch.
// Patch application sometimes takes a very long time, so use 100 buckets for
// up to an hour.
- SCOPED_UMA_HISTOGRAM_LONG_TIMER("Setup.Install.ApplyArchivePatchTime");
+ start_time = base::TimeTicks::Now();
installer_state.UpdateStage(installer::ENSEMBLE_PATCHING);
if (!archive_helper->EnsemblePatch()) {
installer_state.UpdateStage(installer::BINARY_PATCHING);
@@ -309,6 +324,16 @@ bool UncompressAndPatchChromeArchive(
}
}
+ // Record patch time only if it was successful.
+ elapsed_time = base::TimeTicks::Now() - start_time;
+ if (installer_state.is_background_mode()) {
+ UMA_HISTOGRAM_LONG_TIMES(
+ "Setup.Install.ApplyArchivePatchTime.background", elapsed_time);
+ } else {
+ UMA_HISTOGRAM_LONG_TIMES(
+ "Setup.Install.ApplyArchivePatchTime", elapsed_time);
+ }
+
*archive_type = installer::INCREMENTAL_ARCHIVE_TYPE;
return true;
}
@@ -854,6 +879,15 @@ installer::InstallStatus InstallProducts(
// the -multifail suffix from the Google Update "ap" value.
BrowserDistribution::GetSpecificDistribution(installer_state->state_type())->
UpdateInstallStatus(system_install, archive_type, install_status);
+
+ // Drop to background processing mode if the process was started below the
+ // normal process priority class. This is done here because InstallProducts-
+ // Helper has read-only access to the state and because the action also
+ // affects everything else that runs below.
+ bool entered_background_mode = installer::AdjustProcessPriority();
+ installer_state->set_background_mode(entered_background_mode);
+ VLOG_IF(1, entered_background_mode) << "Entered background processing mode.";
+
if (CheckPreInstallConditions(original_state, installer_state,
&install_status)) {
VLOG(1) << "Installing to " << installer_state->target_path().value();
@@ -1370,11 +1404,6 @@ InstallStatus InstallProductsHelper(const InstallationState& original_state,
const bool system_install = installer_state.system_install();
InstallStatus install_status = UNKNOWN_STATUS;
- // Drop to background processing mode if the process was started below the
- // normal process priority class.
- bool entered_background_mode = AdjustProcessPriority();
- VLOG_IF(1, entered_background_mode) << "Entered background processing mode.";
-
// Create a temp folder where we will unpack Chrome archive. If it fails,
// then we are doomed, so return immediately and no cleanup is required.
SelfCleaningTempDir temp_path;
@@ -1447,8 +1476,15 @@ InstallStatus InstallProductsHelper(const InstallationState& original_state,
NULL);
return UNPACKING_FAILED;
}
- UMA_HISTOGRAM_MEDIUM_TIMES("Setup.Install.UnpackFullArchiveTime",
- base::TimeTicks::Now() - start_time);
+
+ base::TimeDelta elapsed_time = base::TimeTicks::Now() - start_time;
+ if (installer_state.is_background_mode()) {
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "Setup.Install.UnpackFullArchiveTime.background", elapsed_time);
+ } else {
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "Setup.Install.UnpackFullArchiveTime", elapsed_time);
+ }
VLOG(1) << "unpacked to " << unpack_path.value();
base::FilePath src_path(
@@ -1796,6 +1832,9 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
!InstallationValidator::ValidateInstallationType(system_install,
&installation_type));
+ UMA_HISTOGRAM_ENUMERATION("Setup.Install.Result", install_status,
+ installer::MAX_INSTALL_STATUS);
+
int return_code = 0;
// MSI demands that custom actions always return 0 (ERROR_SUCCESS) or it will
// rollback the action. If we're uninstalling we want to avoid this, so always
diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc
index 3da5a99..7f4d8471 100644
--- a/chrome/installer/util/installer_state.cc
+++ b/chrome/installer/util/installer_state.cc
@@ -73,8 +73,8 @@ InstallerState::InstallerState()
package_type_(UNKNOWN_PACKAGE_TYPE),
root_key_(NULL),
msi_(false),
- verbose_logging_(false) {
-}
+ background_mode_(false),
+ verbose_logging_(false) {}
InstallerState::InstallerState(Level level)
: operation_(UNINITIALIZED),
@@ -84,6 +84,7 @@ InstallerState::InstallerState(Level level)
package_type_(UNKNOWN_PACKAGE_TYPE),
root_key_(NULL),
msi_(false),
+ background_mode_(false),
verbose_logging_(false) {
// Use set_level() so that root_key_ is updated properly.
set_level(level);
diff --git a/chrome/installer/util/installer_state.h b/chrome/installer/util/installer_state.h
index 2b62465..4791509 100644
--- a/chrome/installer/util/installer_state.h
+++ b/chrome/installer/util/installer_state.h
@@ -123,6 +123,12 @@ class InstallerState {
// flag is set is to be operated on.
bool is_msi() const { return msi_; }
+ // True if the process is running at a reduced "background" priority.
+ bool is_background_mode() const { return background_mode_; }
+
+ // Indicate that the process is or is not running in the background.
+ void set_background_mode(bool bg) { background_mode_ = bg; }
+
// True if the --verbose-logging command-line flag is set or if the
// verbose_logging master preferences option is true.
bool verbose_logging() const { return verbose_logging_; }
@@ -268,6 +274,7 @@ class InstallerState {
HKEY root_key_;
#endif
bool msi_;
+ bool background_mode_;
bool verbose_logging_;
private:
diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h
index ace182f..13c905d 100644
--- a/chrome/installer/util/util_constants.h
+++ b/chrome/installer/util/util_constants.h
@@ -88,6 +88,8 @@ enum InstallStatus {
REENABLE_UPDATES_FAILED = 56, // Autoupdates could not be enabled.
UNPACKING_FAILED = 57, // Unpacking the (possibly patched) uncompressed
// archive failed.
+
+ MAX_INSTALL_STATUS = 58, // Bump this out to make space for new results.
};
// The type of an update archive.
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index a6777275a..25d8a9f 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -47105,6 +47105,14 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>
+<histogram name="Setup.Install.Result" enum="SetupInstallResult">
+ <owner>grt@chromium.org</owner>
+ <owner>bcwhite@chromium.org</owner>
+ <summary>
+ The final exit-result of the entire run of setup.exe on Windows.
+ </summary>
+</histogram>
+
<histogram name="Setup.Install.UncompressArchivePatchTime" units="ms">
<owner>grt@chromium.org</owner>
<summary>
@@ -80665,6 +80673,63 @@ To add a new entry, add it with any value and run test to compute valid value.
<int value="40" label="Prefs Dump"/>
</enum>
+<enum name="SetupInstallResult" type="int">
+ <int value="0" label="First install of Chrome succeeded."/>
+ <int value="1" label="Same version reinstalled for repair."/>
+ <int value="2" label="Chrome successfully updated to new version."/>
+ <int value="3" label="No work done; launched existing Chrome."/>
+ <int value="4" label="Higher version of Chrome already exists."/>
+ <int value="5" label="User level install already exists."/>
+ <int value="6" label="Machine level install already exists."/>
+ <int value="7" label="Install/update failed."/>
+ <int value="8" label="Failed to patch setup.exe."/>
+ <int value="9" label="Current OS not supported."/>
+ <int value="10" label="OS API call failed."/>
+ <int value="11" label="Unable to get Temp directory."/>
+ <int value="12" label="Failed to uncompress Chrome archive."/>
+ <int value="13" label="Something wrong with the installer archive."/>
+ <int value="14" label="User trying system level install is not Admin."/>
+ <int value="15" label="Chrome not installed (during uninstall)."/>
+ <int value="16" label="Chrome currently running (during uninstall)."/>
+ <int value="17" label="User has confirmed Chrome uninstall."/>
+ <int value="18" label="User okayed uninstall and profile deletion."/>
+ <int value="19" label="Chrome successfully uninstalled."/>
+ <int value="20" label="Chrome uninstallation failed."/>
+ <int value="21" label="User cancelled Chrome uninstallation."/>
+ <int value="22" label="Unknown status (this should never happen)."/>
+ <int value="23" label="Rename of new_chrome.exe to chrome.exe worked."/>
+ <int value="24" label="Rename of new_chrome.exe failed."/>
+ <int value="25" label="EULA dialog was not accepted by user."/>
+ <int value="26" label="EULA dialog was accepted by user."/>
+ <int value="27" label="EULA accepted with the crash option selected."/>
+ <int value="28" label="Installation directory is in use by another process."/>
+ <int value="29" label="Uninstallation required a reboot."/>
+ <int value="30" label="Chrome successfully updated but old version running."/>
+ <int value="31" label="Chrome repair failed as Chrome was running."/>
+ <int value="32" label="Setup has been re-launched as the interactive user."/>
+ <int value="33"
+ label="The chrome-sxs option provided does not work with other command
+ line options."/>
+ <int value="42" label="Failed to apply a diff patch."/>
+ <int value="47"
+ label="A non-install option was called with an invalid installer state."/>
+ <int value="49"
+ label="The arguments of --patch were missing or they were invalid for
+ any reason."/>
+ <int value="50"
+ label="No previous version archive found for differential update."/>
+ <int value="51"
+ label="No multi-install products to update. The binaries will be
+ uninstalled if they are not in use."/>
+ <int value="52" label="The binaries were uninstalled."/>
+ <int value="53" label="An unsupported legacy option was given."/>
+ <int value="54" label="Current CPU not supported."/>
+ <int value="55" label="Autoupdates are now enabled."/>
+ <int value="56" label="Autoupdates could not be enabled."/>
+ <int value="57"
+ label="Unpacking the (possibly patched) uncompressed archive failed."/>
+</enum>
+
<enum name="SHA1Status" type="int">
<summary>
Whether or not SHA-1 was present in a certificate chain and, if it was, when
@@ -89744,6 +89809,15 @@ To add a new entry, add it with any value and run test to compute valid value.
<affected-histogram name="SessionRestore.ForegroundTabFirstPaint3"/>
</histogram_suffixes>
+<histogram_suffixes name="SetupInstallTimes" separator=".">
+ <suffix name="background" label="Background; lowered priority."/>
+ <affected-histogram name="Setup.Install.ApplyArchivePatchTime"/>
+ <affected-histogram name="Setup.Install.HasArchivePatch"/>
+ <affected-histogram name="Setup.Install.UncompressArchivePatchTime"/>
+ <affected-histogram name="Setup.Install.UncompressFullArchiveTime"/>
+ <affected-histogram name="Setup.Install.UnpackFullArchiveTime"/>
+</histogram_suffixes>
+
<histogram_suffixes name="ShillWiFiRememberedNetworkSecurityMode" separator=".">
<suffix name="802_1x" label="Network is secured with 802.1x"/>
<suffix name="none" label="Network is not secured"/>