summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-18 17:07:10 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-18 17:07:10 +0000
commitcea159c9938d30c42bbba30bd476496a014419dc (patch)
tree23dfb48784c275c80a3cedd32c067730231c1f40
parentce138757dd25ccf9e5ccbbfc815b1eece5af95ce (diff)
downloadchromium_src-cea159c9938d30c42bbba30bd476496a014419dc.zip
chromium_src-cea159c9938d30c42bbba30bd476496a014419dc.tar.gz
chromium_src-cea159c9938d30c42bbba30bd476496a014419dc.tar.bz2
sync: replace Sync.Startup.TimeDeferred with TimeDeferred2
TimeDeferred2 uses a more appropriate custom range for the data. BUG=none. Review URL: https://codereview.chromium.org/202493002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257664 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/sync/startup_controller.cc17
-rw-r--r--chrome/browser/sync/startup_controller.h3
-rw-r--r--tools/metrics/histograms/histograms.xml10
3 files changed, 25 insertions, 5 deletions
diff --git a/chrome/browser/sync/startup_controller.cc b/chrome/browser/sync/startup_controller.cc
index 05b947a..b305ad7 100644
--- a/chrome/browser/sync/startup_controller.cc
+++ b/chrome/browser/sync/startup_controller.cc
@@ -165,6 +165,16 @@ bool StartupController::TryStart() {
return false;
}
+void StartupController::RecordTimeDeferred() {
+ DCHECK(!start_up_time_.is_null());
+ base::TimeDelta time_deferred = base::Time::Now() - start_up_time_;
+ UMA_HISTOGRAM_CUSTOM_TIMES("Sync.Startup.TimeDeferred2",
+ time_deferred,
+ base::TimeDelta::FromSeconds(0),
+ base::TimeDelta::FromMinutes(2),
+ 60);
+}
+
void StartupController::OnFallbackStartupTimerExpired() {
DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSyncDisableDeferredStartup));
@@ -173,9 +183,7 @@ void StartupController::OnFallbackStartupTimerExpired() {
return;
DVLOG(2) << "Sync deferred init fallback timer expired, starting backend.";
- DCHECK(!start_up_time_.is_null());
- base::TimeDelta time_deferred = base::Time::Now() - start_up_time_;
- UMA_HISTOGRAM_TIMES("Sync.Startup.TimeDeferred", time_deferred);
+ RecordTimeDeferred();
UMA_HISTOGRAM_ENUMERATION("Sync.Startup.DeferredInitTrigger",
TRIGGER_FALLBACK_TIMER,
MAX_TRIGGER_VALUE);
@@ -209,8 +217,7 @@ void StartupController::OnDataTypeRequestsSyncStartup(syncer::ModelType type) {
// We could measure the time spent deferred on a per-datatype basis, but
// for now this is probably sufficient.
if (!start_up_time_.is_null()) {
- base::TimeDelta time_deferred = base::Time::Now() - start_up_time_;
- UMA_HISTOGRAM_TIMES("Sync.Startup.TimeDeferred", time_deferred);
+ RecordTimeDeferred();
UMA_HISTOGRAM_ENUMERATION("Sync.Startup.TypeTriggeringInit",
ModelTypeToHistogramInt(type),
syncer::MODEL_TYPE_COUNT);
diff --git a/chrome/browser/sync/startup_controller.h b/chrome/browser/sync/startup_controller.h
index 6ef4af53..0dbceb5 100644
--- a/chrome/browser/sync/startup_controller.h
+++ b/chrome/browser/sync/startup_controller.h
@@ -72,6 +72,9 @@ class StartupController {
bool StartUp(StartUpDeferredOption deferred_option);
void OnFallbackStartupTimerExpired();
+ // Records time spent in deferred state with UMA histograms.
+ void RecordTimeDeferred();
+
// True if we should start sync ASAP because either a SyncableService has
// requested it, or we're done waiting for a sign and decided to go ahead.
bool received_start_request_;
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 41e9f8c..00c394e 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -22630,6 +22630,16 @@ other types of suffix sets.
</histogram>
<histogram name="Sync.Startup.TimeDeferred" units="milliseconds">
+ <obsolete>
+ Deprecated, see TimeDeferred2.
+ </obsolete>
+ <summary>
+ Time spent after ProfileSyncService *creation* but before SyncBackendHost
+ initialization.
+ </summary>
+</histogram>
+
+<histogram name="Sync.Startup.TimeDeferred2" units="milliseconds">
<summary>
Time spent after ProfileSyncService *creation* but before SyncBackendHost
initialization.