Chromium Code Reviews| Index: components/domain_reliability/uploader.cc |
| diff --git a/components/domain_reliability/uploader.cc b/components/domain_reliability/uploader.cc |
| index 10084569a302b26948e6ad2656d9508a83e029ed..d2388fe91224ca21d0110aafc426780211d621f0 100644 |
| --- a/components/domain_reliability/uploader.cc |
| +++ b/components/domain_reliability/uploader.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/stl_util.h" |
| #include "base/supports_user_data.h" |
| #include "net/base/load_flags.h" |
| +#include "net/base/net_errors.h" |
| #include "net/url_request/url_fetcher.h" |
| #include "net/url_request/url_fetcher_delegate.h" |
| #include "net/url_request/url_request_context_getter.h" |
| @@ -93,13 +94,25 @@ class DomainReliabilityUploaderImpl |
| UploadCallbackMap::iterator callback_it = upload_callbacks_.find(fetcher); |
| DCHECK(callback_it != upload_callbacks_.end()); |
| - VLOG(1) << "Upload finished with " << fetcher->GetResponseCode(); |
| + int net_error; |
| + { |
| + const net::URLRequestStatus& status = fetcher->GetStatus(); |
| + if (status.status() == net::URLRequestStatus::FAILED) |
| + net_error = status.error(); |
| + else |
| + net_error = net::OK; |
|
davidben
2014/10/30 22:26:55
+mmenke: FYI, here's another one of these. We real
mmenke
2014/10/30 22:42:59
I'd like to get rid of the double-value status ent
Deprecated (see juliatuttle)
2014/10/31 18:54:01
Why does ERR_ABORTED not count?
mmenke
2014/10/31 18:55:55
The same reason you're not counting net::URLReques
Deprecated (see juliatuttle)
2014/10/31 21:25:39
Alright, I'm counting CANCELED as ERR_ABORTED.
|
| + } |
| + int http_response_code = fetcher->GetResponseCode(); |
| + |
| + VLOG(1) << "Upload finished with net error " << net_error << |
| + " and HTTP response code " << http_response_code; |
| UMA_HISTOGRAM_SPARSE_SLOWLY("DomainReliability.UploadResponseCode", |
| - fetcher->GetResponseCode()); |
| + http_response_code); |
| + UMA_HISTOGRAM_SPARSE_SLOWLY("DomainReliability.UploadNetError", |
| + -net_error); |
|
davidben
2014/10/30 22:26:55
Should this be
UMA_HISTOGRAM_CUSTOM_ENUMERATION("
Deprecated (see juliatuttle)
2014/10/31 18:54:01
This is rare enough that I think a sparse one will
|
| - bool success = fetcher->GetResponseCode() == 200; |
| - callback_it->second.Run(success); |
| + callback_it->second.Run(http_response_code == 200); |
| delete callback_it->first; |
| upload_callbacks_.erase(callback_it); |