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 |