summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authorjuyik@chromium.org <juyik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-12 01:36:41 +0000
committerjuyik@chromium.org <juyik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-12 01:36:41 +0000
commitbb05f4c19baabb9122cd6228f99f69e0acdb2771 (patch)
tree987d77c43308478809faa3b98f40418c72e2d5e0 /google_apis
parentb95bff90f6b02cba748b89b4de07296a095de4a7 (diff)
downloadchromium_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
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/gcm/engine/registration_request.cc3
-rw-r--r--google_apis/gcm/engine/registration_request.h8
2 files changed, 11 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.