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

Unified Diff: google_apis/gcm/engine/gcm_unregistration_request_handler.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
Index: google_apis/gcm/engine/gcm_unregistration_request_handler.cc
diff --git a/google_apis/gcm/engine/gcm_unregistration_request_handler.cc b/google_apis/gcm/engine/gcm_unregistration_request_handler.cc
index 86f473b708855b7838b673b3a5f2a99c939f342c..5d37382c3ed6b2f904fbf26e4aa3086850776469 100644
--- a/google_apis/gcm/engine/gcm_unregistration_request_handler.cc
+++ b/google_apis/gcm/engine/gcm_unregistration_request_handler.cc
@@ -4,6 +4,7 @@
#include "google_apis/gcm/engine/gcm_unregistration_request_handler.h"
+#include "base/metrics/histogram.h"
#include "google_apis/gcm/base/gcm_util.h"
#include "net/url_request/url_fetcher.h"
@@ -65,4 +66,20 @@ UnregistrationRequest::Status GCMUnregistrationRequestHandler::ParseResponse(
return UnregistrationRequest::RESPONSE_PARSING_FAILED;
}
+void GCMUnregistrationRequestHandler::ReportUMAs(
+ UnregistrationRequest::Status status,
+ int retry_count,
+ base::TimeDelta complete_time) {
+ UMA_HISTOGRAM_ENUMERATION("GCM.UnregistrationRequestStatus",
+ status,
+ UnregistrationRequest::UNREGISTRATION_STATUS_COUNT);
+
+ // Other UMAs are only reported when the request succeeds.
+ if (status != UnregistrationRequest::SUCCESS)
+ return;
+
+ UMA_HISTOGRAM_COUNTS("GCM.UnregistrationRetryCount", retry_count);
+ UMA_HISTOGRAM_TIMES("GCM.UnregistrationCompleteTime", complete_time);
+}
+
} // namespace gcm

Powered by Google App Engine
This is Rietveld 408576698