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

Side by Side Diff: google_apis/gcm/engine/instance_id_delete_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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "google_apis/gcm/engine/instance_id_delete_token_request_handler.h" 5 #include "google_apis/gcm/engine/instance_id_delete_token_request_handler.h"
6 6
7 #include "base/metrics/histogram.h"
7 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
8 #include "google_apis/gcm/base/gcm_util.h" 9 #include "google_apis/gcm/base/gcm_util.h"
9 #include "net/url_request/url_fetcher.h" 10 #include "net/url_request/url_fetcher.h"
10 #include "net/url_request/url_request_context_getter.h" 11 #include "net/url_request/url_request_context_getter.h"
11 12
12 namespace gcm { 13 namespace gcm {
13 14
14 namespace { 15 namespace {
15 16
16 // Request constants. 17 // Request constants.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 DVLOG(1) << "Failed to get response body."; 60 DVLOG(1) << "Failed to get response body.";
60 return UnregistrationRequest::NO_RESPONSE_BODY; 61 return UnregistrationRequest::NO_RESPONSE_BODY;
61 } 62 }
62 63
63 if (response.find(kTokenPrefix) == std::string::npos) 64 if (response.find(kTokenPrefix) == std::string::npos)
64 return UnregistrationRequest::RESPONSE_PARSING_FAILED; 65 return UnregistrationRequest::RESPONSE_PARSING_FAILED;
65 66
66 return UnregistrationRequest::SUCCESS; 67 return UnregistrationRequest::SUCCESS;
67 } 68 }
68 69
70 void InstanceIDDeleteTokenRequestHandler::ReportUMAs(
71 UnregistrationRequest::Status status,
72 int retry_count,
73 base::TimeDelta complete_time) {
74 UMA_HISTOGRAM_ENUMERATION("InstanceID.DeleteToken.RequestStatus",
75 status,
76 UnregistrationRequest::UNREGISTRATION_STATUS_COUNT);
77
78 // Other UMAs are only reported when the request succeeds.
79 if (status != UnregistrationRequest::SUCCESS)
80 return;
81
82 UMA_HISTOGRAM_COUNTS("InstanceID.DeleteToken.RetryCount", retry_count);
83 UMA_HISTOGRAM_TIMES("InstanceID.DeleteToken.CompleteTime", complete_time);
84 }
85
69 } // namespace gcm 86 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698