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

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

Issue 270783002: [GCM] Add more UMA to GCM (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to land Created 6 years, 7 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/unregistration_request.h ('k') | google_apis/gcm/gcm_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/unregistration_request.cc
diff --git a/google_apis/gcm/engine/unregistration_request.cc b/google_apis/gcm/engine/unregistration_request.cc
index 92136bff3f1ed7547521d20930e4fc110b0a99a2..2b8c97dadf1066f56a64d31fd657bbda929059c1 100644
--- a/google_apis/gcm/engine/unregistration_request.cc
+++ b/google_apis/gcm/engine/unregistration_request.cc
@@ -159,6 +159,7 @@ void UnregistrationRequest::Start() {
DVLOG(1) << "Performing unregistration for: " << request_info_.app_id;
recorder_->RecordUnregistrationSent(request_info_.app_id);
+ request_start_time_ = base::TimeTicks::Now();
url_fetcher_->Start();
}
@@ -204,11 +205,20 @@ void UnregistrationRequest::OnURLFetchComplete(const net::URLFetcher* source) {
status == INCORRECT_APP_ID ||
status == RESPONSE_PARSING_FAILED) {
RetryWithBackoff(true);
- } else {
- // status == SUCCESS || HTTP_NOT_OK || NO_RESPONSE_BODY ||
- // INVALID_PARAMETERS || UNKNOWN_ERROR
- callback_.Run(status);
+ return;
}
+
+ // status == SUCCESS || HTTP_NOT_OK || NO_RESPONSE_BODY ||
+ // INVALID_PARAMETERS || UNKNOWN_ERROR
+
+ if (status == SUCCESS) {
+ UMA_HISTOGRAM_COUNTS("GCM.UnregistrationRetryCount",
+ backoff_entry_.failure_count());
+ UMA_HISTOGRAM_TIMES("GCM.UnregistrationCompleteTime",
+ base::TimeTicks::Now() - request_start_time_);
+ }
+
+ callback_.Run(status);
}
} // namespace gcm
« no previous file with comments | « google_apis/gcm/engine/unregistration_request.h ('k') | google_apis/gcm/gcm_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698