diff options
author | skrul@chromium.org <skrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 23:13:09 +0000 |
---|---|---|
committer | skrul@chromium.org <skrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 23:13:09 +0000 |
commit | 5e7a6bc9cca84dc5554ce9f145f83871972c0725 (patch) | |
tree | c64bae022811122c94ca74c980297bedb387072f | |
parent | eb789fdc0ec3f6a621b3954d4d3626b92e3d5c0e (diff) | |
download | chromium_src-5e7a6bc9cca84dc5554ce9f145f83871972c0725.zip chromium_src-5e7a6bc9cca84dc5554ce9f145f83871972c0725.tar.gz chromium_src-5e7a6bc9cca84dc5554ce9f145f83871972c0725.tar.bz2 |
At some UMA counters to log when various failures happen.
BUG=40950
Review URL: http://codereview.chromium.org/1634006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44156 0039d316-1c4b-4281-b951-d872f2087c98
6 files changed, 36 insertions, 14 deletions
diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.cc b/chrome/browser/sync/glue/autofill_data_type_controller.cc index cdb31ce..7f2e1bc 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller.cc @@ -168,6 +168,12 @@ void AutofillDataTypeController::StartDoneImpl( set_state(new_state); start_callback_->Run(result); start_callback_.reset(); + + if (result == UNRECOVERABLE_ERROR || result == ASSOCIATION_FAILED) { + UMA_HISTOGRAM_ENUMERATION("Sync.AutofillStartFailures", + result, + MAX_START_RESULT); + } } void AutofillDataTypeController::StopImpl() { @@ -191,6 +197,7 @@ void AutofillDataTypeController::OnUnrecoverableError() { ChromeThread::UI, FROM_HERE, NewRunnableMethod(this, &AutofillDataTypeController::OnUnrecoverableErrorImpl)); + UMA_HISTOGRAM_COUNTS("Sync.AutofillRunFailures", 1); } void AutofillDataTypeController::OnUnrecoverableErrorImpl() { diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.cc b/chrome/browser/sync/glue/bookmark_data_type_controller.cc index 97c8ff2..e9cf83f 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller.cc @@ -95,6 +95,7 @@ void BookmarkDataTypeController::Stop() { void BookmarkDataTypeController::OnUnrecoverableError() { unrecoverable_error_detected_ = true; // The ProfileSyncService will invoke our Stop() method in response to this. + UMA_HISTOGRAM_COUNTS("Sync.BookmarkRunFailures", 1); sync_service_->OnUnrecoverableError(); } @@ -150,6 +151,9 @@ void BookmarkDataTypeController::StartFailed(StartResult result) { state_ = NOT_RUNNING; start_callback_->Run(result); start_callback_.reset(); + UMA_HISTOGRAM_ENUMERATION("Sync.BookmarkStartFailures", + result, + MAX_START_RESULT); } } // namespace browser_sync diff --git a/chrome/browser/sync/glue/data_type_controller.h b/chrome/browser/sync/glue/data_type_controller.h index 95bc0b3..f827e03 100644 --- a/chrome/browser/sync/glue/data_type_controller.h +++ b/chrome/browser/sync/glue/data_type_controller.h @@ -36,15 +36,16 @@ class DataTypeController }; enum StartResult { - OK, // The data type has started normally. - OK_FIRST_RUN, // Same as OK, but sent on first successful - // start for this type for this user as - // determined by cloud state. - BUSY, // Start() was called while already in progress. - NOT_ENABLED, // This data type is not enabled for the current user. - ASSOCIATION_FAILED, // An error occurred during model association. - ABORTED, // Start was aborted by calling Stop(). - UNRECOVERABLE_ERROR // An unrecoverable error occured. + OK, // The data type has started normally. + OK_FIRST_RUN, // Same as OK, but sent on first successful + // start for this type for this user as + // determined by cloud state. + BUSY, // Start() was called while already in progress. + NOT_ENABLED, // This data type is not enabled for the current user. + ASSOCIATION_FAILED, // An error occurred during model association. + ABORTED, // Start was aborted by calling Stop(). + UNRECOVERABLE_ERROR, // An unrecoverable error occured. + MAX_START_RESULT }; typedef Callback1<StartResult>::Type StartCallback; diff --git a/chrome/browser/sync/glue/preference_data_type_controller.cc b/chrome/browser/sync/glue/preference_data_type_controller.cc index 940f093..75b964f 100644 --- a/chrome/browser/sync/glue/preference_data_type_controller.cc +++ b/chrome/browser/sync/glue/preference_data_type_controller.cc @@ -92,6 +92,7 @@ void PreferenceDataTypeController::Stop() { void PreferenceDataTypeController::OnUnrecoverableError() { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); unrecoverable_error_detected_ = true; + UMA_HISTOGRAM_COUNTS("Sync.PreferenceRunFailures", 1); sync_service_->OnUnrecoverableError(); } @@ -107,6 +108,9 @@ void PreferenceDataTypeController::StartFailed(StartResult result) { change_processor_.reset(); start_callback_->Run(result); start_callback_.reset(); + UMA_HISTOGRAM_ENUMERATION("Sync.PreferenceStartFailures", + result, + MAX_START_RESULT); } } // namespace browser_sync diff --git a/chrome/browser/sync/glue/theme_data_type_controller.cc b/chrome/browser/sync/glue/theme_data_type_controller.cc index 0d0b2fb..d305c69 100644 --- a/chrome/browser/sync/glue/theme_data_type_controller.cc +++ b/chrome/browser/sync/glue/theme_data_type_controller.cc @@ -50,11 +50,6 @@ void ThemeDataTypeController::Start(StartCallback* start_callback) { model_associator_.reset(sync_components.model_associator); change_processor_.reset(sync_components.change_processor); - bool chrome_has_nodes = false; - if (!model_associator_->ChromeModelHasUserCreatedNodes(&chrome_has_nodes)) { - StartFailed(UNRECOVERABLE_ERROR); - return; - } bool sync_has_nodes = false; if (!model_associator_->SyncModelHasUserCreatedNodes(&sync_has_nodes)) { StartFailed(UNRECOVERABLE_ERROR); @@ -96,6 +91,7 @@ void ThemeDataTypeController::Stop() { void ThemeDataTypeController::OnUnrecoverableError() { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); unrecoverable_error_detected_ = true; + UMA_HISTOGRAM_COUNTS("Sync.ThemeRunFailures", 1); sync_service_->OnUnrecoverableError(); } @@ -109,6 +105,9 @@ void ThemeDataTypeController::StartFailed(StartResult result) { change_processor_.reset(); start_callback_->Run(result); start_callback_.reset(); + UMA_HISTOGRAM_ENUMERATION("Sync.ThemeStartFailures", + result, + MAX_START_RESULT); } } // namespace browser_sync diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.cc b/chrome/browser/sync/glue/typed_url_data_type_controller.cc index 841392e..59b345f 100644 --- a/chrome/browser/sync/glue/typed_url_data_type_controller.cc +++ b/chrome/browser/sync/glue/typed_url_data_type_controller.cc @@ -166,6 +166,12 @@ void TypedUrlDataTypeController::StartDoneImpl( set_state(new_state); start_callback_->Run(result); start_callback_.reset(); + + if (result == UNRECOVERABLE_ERROR || result == ASSOCIATION_FAILED) { + UMA_HISTOGRAM_ENUMERATION("Sync.TypedUrlStartFailures", + result, + MAX_START_RESULT); + } } void TypedUrlDataTypeController::StopImpl() { @@ -192,6 +198,7 @@ void TypedUrlDataTypeController::OnUnrecoverableError() { void TypedUrlDataTypeController::OnUnrecoverableErrorImpl() { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + UMA_HISTOGRAM_COUNTS("Sync.TypedUrlRunFailures", 1); sync_service_->OnUnrecoverableError(); } |