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

Unified Diff: components/variations/service/variations_service.cc

Issue 2384173003: Replace 2 histograms with Variations.SeedFetchResponseOrErrorCode. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/service/variations_service.cc
diff --git a/components/variations/service/variations_service.cc b/components/variations/service/variations_service.cc
index 7d32630dbae236b143ebcb44a671a055e3c8c9f3..8f5d5df8efa9dd05531706b0d24c1e4728aca493 100644
--- a/components/variations/service/variations_service.cc
+++ b/components/variations/service/variations_service.cc
@@ -644,13 +644,15 @@ void VariationsService::OnURLFetchComplete(const net::URLFetcher* source) {
// The fetcher will be deleted when the request is handled.
std::unique_ptr<const net::URLFetcher> request(
pending_seed_request_.release());
- const net::URLRequestStatus& request_status = request->GetStatus();
- if (request_status.status() != net::URLRequestStatus::SUCCESS) {
- UMA_HISTOGRAM_SPARSE_SLOWLY("Variations.FailedRequestErrorCode",
- -request_status.error());
+ const net::URLRequestStatus& status = request->GetStatus();
+ const int response_code = request->GetResponseCode();
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
+ "Variations.SeedFetchResponseOrErrorCode",
+ status.is_success() ? response_code : status.error());
+
+ if (status.status() != net::URLRequestStatus::SUCCESS) {
DVLOG(1) << "Variations server request failed with error: "
- << request_status.error() << ": "
- << net::ErrorToString(request_status.error());
+ << status.error() << ": " << net::ErrorToString(status.error());
// It's common for the very first fetch attempt to fail (e.g. the network
// may not yet be available). In such a case, try again soon, rather than
// waiting the full time interval.
@@ -659,11 +661,6 @@ void VariationsService::OnURLFetchComplete(const net::URLFetcher* source) {
return;
}
- // Log the response code.
- const int response_code = request->GetResponseCode();
- UMA_HISTOGRAM_SPARSE_SLOWLY("Variations.SeedFetchResponseCode",
- response_code);
-
const base::TimeDelta latency =
base::TimeTicks::Now() - last_request_started_time_;
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698