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

Unified Diff: google_apis/gcm/engine/registration_request.cc

Issue 158023007: Add GCM check in status code metric collection. We also decided to collect registration success sig… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 10 months 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 | « google_apis/gcm/engine/checkin_request.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/registration_request.cc
diff --git a/google_apis/gcm/engine/registration_request.cc b/google_apis/gcm/engine/registration_request.cc
index 9e89bacc30301f6237bea700cc414f60e61df103..f0de831545c6260a203e91816f4a042431d86e85 100644
--- a/google_apis/gcm/engine/registration_request.cc
+++ b/google_apis/gcm/engine/registration_request.cc
@@ -73,6 +73,11 @@ bool ShouldRetryWithStatus(RegistrationRequest::Status status) {
status == RegistrationRequest::DEVICE_REGISTRATION_ERROR;
}
+void RecordRegistrationStatusToUMA(RegistrationRequest::Status status) {
+ UMA_HISTOGRAM_ENUMERATION("GCM.RegistrationRequestStatus", status,
+ RegistrationRequest::STATUS_COUNT);
+}
+
} // namespace
RegistrationRequest::RequestInfo::RequestInfo(
@@ -187,6 +192,7 @@ void RegistrationRequest::OnURLFetchComplete(const net::URLFetcher* source) {
if (token_pos != std::string::npos) {
std::string token =
response.substr(token_pos + arraysize(kTokenPrefix) - 1);
+ RecordRegistrationStatusToUMA(SUCCESS);
callback_.Run(SUCCESS, token);
return;
}
@@ -198,8 +204,7 @@ 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);
+ RecordRegistrationStatusToUMA(status);
if (ShouldRetryWithStatus(status)) {
RetryWithBackoff(true);
« no previous file with comments | « google_apis/gcm/engine/checkin_request.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698