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

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

Issue 1167753002: Add more UMAs for Instance ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address more feedback Created 5 years, 6 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/registration_request.h ('k') | google_apis/gcm/engine/unregistration_request.h » ('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 b30bc4ccb3dcc847b36e24ae4fdd89641ad0204f..6537389f1945ee5841570fde066a2f7b27435228 100644
--- a/google_apis/gcm/engine/registration_request.cc
+++ b/google_apis/gcm/engine/registration_request.cc
@@ -65,11 +65,6 @@ bool ShouldRetryWithStatus(RegistrationRequest::Status status) {
status == RegistrationRequest::RESPONSE_PARSING_FAILED;
}
-void RecordRegistrationStatusToUMA(RegistrationRequest::Status status) {
- UMA_HISTOGRAM_ENUMERATION("GCM.RegistrationRequestStatus", status,
- RegistrationRequest::STATUS_COUNT);
-}
-
} // namespace
RegistrationRequest::RequestInfo::RequestInfo(
@@ -228,12 +223,17 @@ RegistrationRequest::Status RegistrationRequest::ParseResponse(
void RegistrationRequest::OnURLFetchComplete(const net::URLFetcher* source) {
std::string token;
Status status = ParseResponse(source, &token);
- RecordRegistrationStatusToUMA(status);
recorder_->RecordRegistrationResponse(
request_info_.app_id,
source_to_record_,
status);
+ DCHECK(custom_request_handler_.get());
+ custom_request_handler_->ReportUMAs(
+ status,
+ backoff_entry_.failure_count(),
+ base::TimeTicks::Now() - request_start_time_);
+
if (ShouldRetryWithStatus(status)) {
if (retries_left_ > 0) {
recorder_->RecordRegistrationRetryRequested(
@@ -249,15 +249,13 @@ void RegistrationRequest::OnURLFetchComplete(const net::URLFetcher* source) {
request_info_.app_id,
source_to_record_,
status);
- RecordRegistrationStatusToUMA(status);
- }
- if (status == SUCCESS) {
- UMA_HISTOGRAM_COUNTS("GCM.RegistrationRetryCount",
- backoff_entry_.failure_count());
- UMA_HISTOGRAM_TIMES("GCM.RegistrationCompleteTime",
- base::TimeTicks::Now() - request_start_time_);
+ // Only REACHED_MAX_RETRIES is reported because the function will skip
+ // reporting count and time when status is not SUCCESS.
+ DCHECK(custom_request_handler_.get());
+ custom_request_handler_->ReportUMAs(status, 0, base::TimeDelta());
}
+
callback_.Run(status, token);
}
« no previous file with comments | « google_apis/gcm/engine/registration_request.h ('k') | google_apis/gcm/engine/unregistration_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698