diff options
author | mek@chromium.org <mek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 06:51:38 +0000 |
---|---|---|
committer | mek@chromium.org <mek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 06:51:38 +0000 |
commit | 4532475cd5a293b3afbe4f511b4d9350efed1f9c (patch) | |
tree | 81ecc709c7bd5b60b237a7a4acd3a8e19df03aa2 | |
parent | 35051a6acb1ed93cde969b8d4528e9972e0ccc38 (diff) | |
download | chromium_src-4532475cd5a293b3afbe4f511b4d9350efed1f9c.zip chromium_src-4532475cd5a293b3afbe4f511b4d9350efed1f9c.tar.gz chromium_src-4532475cd5a293b3afbe4f511b4d9350efed1f9c.tar.bz2 |
Add histograms to record retry counts for downloading manifests and extensions.
This adds the following new histograms to record how often we tried downloading an
extension or update manifest before we gave up or succeeded, separated out for
google hosted extensions and other extensions:
Extension.ManifestFetchSuccessGoogleUrl
Extension.ManifestFetchSuccessOtherUrl
Extension.ManifestFetchFailureGoogleUrl
Extension.ManifestFetchFailureOtherUrl
Extension.CrxFetchSuccessGoogleUrl
Extension.CrxFetchSuccessOtherUrl
Extension.CrxFetchFailureGoogleUrl
Extension.CrxFetchFailureOtherUrl
BUG=12546
Review URL: https://chromiumcodereview.appspot.com/11471017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171710 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/updater/extension_downloader.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/extensions/updater/extension_downloader.cc b/chrome/browser/extensions/updater/extension_downloader.cc index d10edca..4d9c23a 100644 --- a/chrome/browser/extensions/updater/extension_downloader.cc +++ b/chrome/browser/extensions/updater/extension_downloader.cc @@ -84,6 +84,16 @@ enum FileWriteResult { NUM_FILE_WRITE_RESULTS, }; +#define RETRY_HISTOGRAM(name, retry_count, url) \ + if ((url).DomainIs("google.com")) \ + UMA_HISTOGRAM_CUSTOM_COUNTS( \ + "Extension." name "RetryCountGoogleUrl", retry_count, 1, \ + kMaxRetries, kMaxRetries+1); \ + else \ + UMA_HISTOGRAM_CUSTOM_COUNTS( \ + "Extension." name "RetryCountOtherUrl", retry_count, 1, \ + kMaxRetries, kMaxRetries+1) + void RecordFileUpdateHistogram(FileWriteResult file_write_result) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); UMA_HISTOGRAM_ENUMERATION("Extensions.UpdaterWriteCrxAsFile", @@ -455,6 +465,8 @@ void ExtensionDownloader::OnManifestFetchComplete( // available, we want to fire off requests to fetch those updates. if (status.status() == net::URLRequestStatus::SUCCESS && (response_code == 200 || (url.SchemeIsFile() && data.length() > 0))) { + RETRY_HISTOGRAM("ManifestFetchSuccess", + manifests_queue_.active_request_failure_count(), url); VLOG(2) << "beginning manifest parse for " << url; scoped_refptr<SafeManifestParser> safe_parser( new SafeManifestParser( @@ -470,6 +482,8 @@ void ExtensionDownloader::OnManifestFetchComplete( manifests_queue_.active_request_failure_count() < kMaxRetries) { manifests_queue_.RetryRequest(backoff_delay); } else { + RETRY_HISTOGRAM("ManifestFetchFailure", + manifests_queue_.active_request_failure_count(), url); NotifyExtensionsDownloadFailed( manifests_queue_.active_request()->extension_ids(), manifests_queue_.active_request()->request_ids(), @@ -693,6 +707,8 @@ void ExtensionDownloader::OnCRXFetchComplete( id, ExtensionDownloaderDelegate::CRX_FETCH_FAILED, ping, request_ids); } else if (status.status() == net::URLRequestStatus::SUCCESS && (response_code == 200 || url.SchemeIsFile())) { + RETRY_HISTOGRAM("CrxFetchSuccess", + extensions_queue_.active_request_failure_count(), url); if (id == kBlacklistAppID) { std::string data; source->GetResponseAsString(&data); @@ -717,6 +733,8 @@ void ExtensionDownloader::OnCRXFetchComplete( extensions_queue_.active_request_failure_count() < kMaxRetries) { extensions_queue_.RetryRequest(backoff_delay); } else { + RETRY_HISTOGRAM("CrxFetchFailure", + extensions_queue_.active_request_failure_count(), url); delegate_->OnExtensionDownloadFailed( id, ExtensionDownloaderDelegate::CRX_FETCH_FAILED, ping, request_ids); } |