Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: components/sync/driver/data_type_manager_impl.cc

Issue 2484903003: [Sync] Sync.ConfigureTime_Long.OK shouldn't accumulate multiple configurations (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sync/driver/data_type_manager_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/driver/data_type_manager_impl.cc
diff --git a/components/sync/driver/data_type_manager_impl.cc b/components/sync/driver/data_type_manager_impl.cc
index 84ace56b06d966bf0bae106603726ddd8b99b15b..78f4f0c9764f78158af4a4f47c9efe6a6ee56b49 100644
--- a/components/sync/driver/data_type_manager_impl.cc
+++ b/components/sync/driver/data_type_manager_impl.cc
@@ -638,18 +638,18 @@ void DataTypeManagerImpl::NotifyStart() {
void DataTypeManagerImpl::NotifyDone(const ConfigureResult& raw_result) {
catch_up_in_progress_ = false;
- AddToConfigureTime();
+ DCHECK(!last_restart_time_.is_null());
+ base::TimeDelta configure_time = base::Time::Now() - last_restart_time_;
ConfigureResult result = raw_result;
result.data_type_status_table = data_type_status_table_;
- DVLOG(1) << "Total time spent configuring: "
- << configure_time_delta_.InSecondsF() << "s";
+ DVLOG(1) << "Total time spent configuring: " << configure_time.InSecondsF()
+ << "s";
switch (result.status) {
case DataTypeManager::OK:
DVLOG(1) << "NotifyDone called with result: OK";
- UMA_HISTOGRAM_LONG_TIMES("Sync.ConfigureTime_Long.OK",
- configure_time_delta_);
+ UMA_HISTOGRAM_LONG_TIMES("Sync.ConfigureTime_Long.OK", configure_time);
if (debug_info_listener_.IsInitialized() &&
!configuration_stats_.empty()) {
debug_info_listener_.Call(
@@ -661,12 +661,12 @@ void DataTypeManagerImpl::NotifyDone(const ConfigureResult& raw_result) {
case DataTypeManager::ABORTED:
DVLOG(1) << "NotifyDone called with result: ABORTED";
UMA_HISTOGRAM_LONG_TIMES("Sync.ConfigureTime_Long.ABORTED",
- configure_time_delta_);
+ configure_time);
break;
case DataTypeManager::UNRECOVERABLE_ERROR:
DVLOG(1) << "NotifyDone called with result: UNRECOVERABLE_ERROR";
UMA_HISTOGRAM_LONG_TIMES("Sync.ConfigureTime_Long.UNRECOVERABLE_ERROR",
- configure_time_delta_);
+ configure_time);
break;
case DataTypeManager::UNKNOWN:
NOTREACHED();
@@ -679,11 +679,6 @@ DataTypeManager::State DataTypeManagerImpl::state() const {
return state_;
}
-void DataTypeManagerImpl::AddToConfigureTime() {
- DCHECK(!last_restart_time_.is_null());
- configure_time_delta_ += (base::Time::Now() - last_restart_time_);
-}
-
ModelTypeSet DataTypeManagerImpl::GetEnabledTypes() const {
return Difference(last_requested_types_,
data_type_status_table_.GetFailedTypes());
« no previous file with comments | « components/sync/driver/data_type_manager_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698