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

Unified Diff: google_apis/gcm/engine/instance_id_get_token_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/instance_id_get_token_request_handler.cc
diff --git a/google_apis/gcm/engine/instance_id_get_token_request_handler.cc b/google_apis/gcm/engine/instance_id_get_token_request_handler.cc
index ebf6279af0502682268c1c681125e51cb111cb3d..1ca735bdc0c1d571957ab23caf32a14f9e0f9e56 100644
--- a/google_apis/gcm/engine/instance_id_get_token_request_handler.cc
+++ b/google_apis/gcm/engine/instance_id_get_token_request_handler.cc
@@ -4,6 +4,7 @@
#include "google_apis/gcm/engine/instance_id_get_token_request_handler.h"
+#include "base/metrics/histogram.h"
#include "base/strings/string_number_conversions.h"
#include "google_apis/gcm/base/gcm_util.h"
#include "net/url_request/url_request_context_getter.h"
@@ -53,4 +54,20 @@ void InstanceIDGetTokenRequestHandler::BuildRequestBody(std::string* body){
BuildFormEncoding(kSubtypeKey, authorized_entity_, body);
}
+void InstanceIDGetTokenRequestHandler::ReportUMAs(
+ RegistrationRequest::Status status,
+ int retry_count,
+ base::TimeDelta complete_time) {
+ UMA_HISTOGRAM_ENUMERATION("InstanceID.GetToken.RequestStatus",
+ status,
+ RegistrationRequest::STATUS_COUNT);
+
+ // Other UMAs are only reported when the request succeeds.
+ if (status != RegistrationRequest::SUCCESS)
+ return;
+
+ UMA_HISTOGRAM_COUNTS("InstanceID.GetToken.RetryCount", retry_count);
+ UMA_HISTOGRAM_TIMES("InstanceID.GetToken.CompleteTime", complete_time);
+}
+
} // namespace gcm
« no previous file with comments | « google_apis/gcm/engine/instance_id_get_token_request_handler.h ('k') | google_apis/gcm/engine/registration_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698