diff options
author | juyik@chromium.org <juyik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-12 01:36:41 +0000 |
---|---|---|
committer | juyik@chromium.org <juyik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-12 01:36:41 +0000 |
commit | bb05f4c19baabb9122cd6228f99f69e0acdb2771 (patch) | |
tree | 987d77c43308478809faa3b98f40418c72e2d5e0 | |
parent | b95bff90f6b02cba748b89b4de07296a095de4a7 (diff) | |
download | chromium_src-bb05f4c19baabb9122cd6228f99f69e0acdb2771.zip chromium_src-bb05f4c19baabb9122cd6228f99f69e0acdb2771.tar.gz chromium_src-bb05f4c19baabb9122cd6228f99f69e0acdb2771.tar.bz2 |
Add GCM registration status code metric collection.
BUG=284553
Review URL: https://codereview.chromium.org/139493011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250597 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | google_apis/gcm/engine/registration_request.cc | 3 | ||||
-rw-r--r-- | google_apis/gcm/engine/registration_request.h | 8 | ||||
-rw-r--r-- | tools/metrics/histograms/histograms.xml | 14 |
3 files changed, 25 insertions, 0 deletions
diff --git a/google_apis/gcm/engine/registration_request.cc b/google_apis/gcm/engine/registration_request.cc index 81c5817..5635e5e 100644 --- a/google_apis/gcm/engine/registration_request.cc +++ b/google_apis/gcm/engine/registration_request.cc @@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/message_loop/message_loop.h" +#include "base/metrics/histogram.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" #include "net/base/escape.h" @@ -213,6 +214,8 @@ void RegistrationRequest::OnURLFetchComplete(const net::URLFetcher* source) { response.substr(error_pos + arraysize(kErrorPrefix) - 1); status = GetStatusFromError(error); } + UMA_HISTOGRAM_ENUMERATION("GCM.RegistrationRequestStatus", status, + RegistrationRequest::STATUS_COUNT); if (ShouldRetryWithStatus(status)) { RetryWithBackoff(true); diff --git a/google_apis/gcm/engine/registration_request.h b/google_apis/gcm/engine/registration_request.h index 6360cf7..e21004e 100644 --- a/google_apis/gcm/engine/registration_request.h +++ b/google_apis/gcm/engine/registration_request.h @@ -29,6 +29,10 @@ namespace gcm { // be authorized to address the application using it's assigned registration ID. class GCM_EXPORT RegistrationRequest : public net::URLFetcherDelegate { public: + // This enum is also used in an UMA histogram (GCMRegistrationRequestStatus + // enum defined in tools/metrics/histograms/histogram.xml). Hence the entries + // here shouldn't be deleted or re-ordered and new ones should be added to + // the end. enum Status { SUCCESS, // Registration completed successfully. INVALID_PARAMETERS, // One of request paramteres was invalid. @@ -36,6 +40,10 @@ class GCM_EXPORT RegistrationRequest : public net::URLFetcherDelegate { AUTHENTICATION_FAILED, // Authentication failed. DEVICE_REGISTRATION_ERROR, // Chrome is not properly registered. UNKNOWN_ERROR, // Unknown error. + // NOTE: always keep this entry at the end. Add new status types only + // immediately above this line. Make sure to update the corresponding + // histogram enum accordingly. + STATUS_COUNT }; // Callback completing the registration request. diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index b6af626..a811a2c 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -5476,6 +5476,11 @@ other types of suffix sets. </summary> </histogram> +<histogram name="GCM.RegistrationRequestStatus" + enum="GCMRegistrationRequestStatus"> + <summary>Status code of the outcome of a GCM registration request.</summary> +</histogram> + <histogram name="GCM.RestoredIncomingMessages"> <summary> Number of unacknowledged incoming messages restored from the persistent @@ -26353,6 +26358,15 @@ other types of suffix sets. <int value="8" label="Overflow"/> </enum> +<enum name="GCMRegistrationRequestStatus" type="int"> + <int value="0" label="Success (this is not logged currently)"/> + <int value="1" label="Invalid parameters"/> + <int value="2" label="Invalid sender"/> + <int value="3" label="Authentication failed"/> + <int value="4" label="Device registration error"/> + <int value="5" label="Unknown error"/> +</enum> + <enum name="GDataAuthResult" type="int"> <int value="0" label="FAILURE"/> <int value="1" label="SUCCESS"/> |