Index: chrome/installer/setup/setup_main.cc |
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc |
index 06f69cac43e49251ff5749625eeadf5e12b883f6..ebae7d3df3d48e7daa6639e101df5f77e2ab2744 100644 |
--- a/chrome/installer/setup/setup_main.cc |
+++ b/chrome/installer/setup/setup_main.cc |
@@ -21,6 +21,7 @@ |
#include "base/files/scoped_temp_dir.h" |
#include "base/macros.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/metrics/histogram_macros.h" |
#include "base/path_service.h" |
#include "base/process/launch.h" |
#include "base/process/memory.h" |
@@ -29,6 +30,7 @@ |
#include "base/strings/string_util.h" |
#include "base/strings/stringprintf.h" |
#include "base/strings/utf_string_conversions.h" |
+#include "base/time/time.h" |
#include "base/values.h" |
#include "base/version.h" |
#include "base/win/process_startup_helper.h" |
@@ -251,6 +253,7 @@ bool UncompressAndPatchChromeArchive( |
installer::InstallStatus* install_status, |
const base::Version& previous_version) { |
installer_state.UpdateStage(installer::UNCOMPRESSING); |
+ base::TimeTicks start_time = base::TimeTicks::Now(); |
if (!archive_helper->Uncompress(NULL)) { |
*install_status = installer::UNCOMPRESSION_FAILED; |
installer_state.WriteInstallerResult(*install_status, |
@@ -258,14 +261,24 @@ bool UncompressAndPatchChromeArchive( |
NULL); |
return false; |
} |
+ base::TimeDelta elapsed_time = base::TimeTicks::Now() - start_time; |
// Short-circuit if uncompression produced the uncompressed archive rather |
// than a patch file. |
if (base::PathExists(archive_helper->target())) { |
bcwhite
2016/02/25 16:46:50
Could extract the condition into a bool and have o
grt (UTC plus 2)
2016/02/25 17:45:26
Done.
|
*archive_type = installer::FULL_ARCHIVE_TYPE; |
+ UMA_HISTOGRAM_BOOLEAN("Setup.Install.HasArchivePatch", false); |
+ // Uncompression alone hopefully takes less than 3 minutes even on slow |
+ // machines. |
+ UMA_HISTOGRAM_MEDIUM_TIMES("Setup.Install.UncompressFullArchiveTime", |
+ elapsed_time); |
return true; |
} |
+ UMA_HISTOGRAM_BOOLEAN("Setup.Install.HasArchivePatch", true); |
+ 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, |
installer_state, |
@@ -281,6 +294,9 @@ bool UncompressAndPatchChromeArchive( |
archive_helper->set_patch_source(patch_source); |
// 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.ApplyArchivePathTime"); |
bcwhite
2016/02/25 16:46:50
ApplyArchivePatchTime (Patch vs Path)
grt (UTC plus 2)
2016/02/25 17:45:26
Done.
|
installer_state.UpdateStage(installer::ENSEMBLE_PATCHING); |
if (!archive_helper->EnsemblePatch()) { |
installer_state.UpdateStage(installer::BINARY_PATCHING); |
@@ -1420,6 +1436,7 @@ InstallStatus InstallProductsHelper(const InstallationState& original_state, |
} |
// Unpack the uncompressed archive. |
+ base::TimeTicks start_time = base::TimeTicks::Now(); |
if (LzmaUtil::UnPackArchive(uncompressed_archive.value(), |
unpack_path.value(), |
NULL)) { |
@@ -1429,6 +1446,8 @@ InstallStatus InstallProductsHelper(const InstallationState& original_state, |
NULL); |
return UNPACKING_FAILED; |
} |
+ UMA_HISTOGRAM_MEDIUM_TIMES("Setup.Install.UnpackFullArchiveTime", |
+ base::TimeTicks::Now() - start_time); |
VLOG(1) << "unpacked to " << unpack_path.value(); |
base::FilePath src_path( |