Chromium Code Reviews| Index: content/browser/loader/resource_dispatcher_host_impl.cc |
| diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc |
| index d758f687987af444c94f1ed25d29cfbd25fc31d5..caa02ef8e34b75650a3e95366cb8e689e0850f8d 100644 |
| --- a/content/browser/loader/resource_dispatcher_host_impl.cc |
| +++ b/content/browser/loader/resource_dispatcher_host_impl.cc |
| @@ -24,6 +24,7 @@ |
| #include "base/profiler/scoped_tracker.h" |
| #include "base/stl_util.h" |
| #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
| +#include "base/time/time.h" |
| #include "content/browser/appcache/appcache_interceptor.h" |
| #include "content/browser/appcache/chrome_appcache_service.h" |
| #include "content/browser/cert_store_impl.h" |
| @@ -862,6 +863,41 @@ void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) { |
| "Net.ErrorCodesForMainFrame3", |
| -loader->request()->status().error()); |
| + // Record time to success and error for the most common errors, and for |
| + // the aggregate remainder errors. |
| + base::TimeDelta request_loading_time( |
| + base::Time::Now() - loader->request()->request_time()); |
| + switch (loader->request()->status().error()) { |
| + case net::OK: |
| + UMA_HISTOGRAM_LONG_TIMES( |
| + "Net.RequestTime.Success", request_loading_time); |
| + break; |
| + case net::ERR_ABORTED: |
| + UMA_HISTOGRAM_LONG_TIMES( |
| + "Net.RequestTime.ErrAborted", request_loading_time); |
| + break; |
| + case net::ERR_CONNECTION_RESET: |
| + UMA_HISTOGRAM_LONG_TIMES( |
| + "Net.RequestTime.ErrConnectionReset", request_loading_time); |
| + break; |
| + case net::ERR_INTERNET_DISCONNECTED: |
| + UMA_HISTOGRAM_LONG_TIMES( |
| + "Net.RequestTime.ErrInternetDisconnected", request_loading_time); |
| + break; |
| + case net::ERR_NAME_NOT_RESOLVED: |
| + UMA_HISTOGRAM_LONG_TIMES( |
| + "Net.RequestTime.ErrNameNotResolved", request_loading_time); |
| + break; |
| + case net::ERR_TIMED_OUT: |
|
mmenke
2015/05/12 20:57:00
Josh was right about ERR_CONNECTION_TIMED_OUT - TI
mmenke
2015/05/12 20:58:15
Oh, we also get it when we sent a TCP packet and n
|
| + UMA_HISTOGRAM_LONG_TIMES( |
| + "Net.RequestTime.ErrTimedOut", request_loading_time); |
| + break; |
| + default: |
| + UMA_HISTOGRAM_LONG_TIMES( |
| + "Net.RequestTime.MiscError", request_loading_time); |
| + break; |
| + } |
| + |
| if (loader->request()->url().SchemeIsCryptographic()) { |
| if (loader->request()->url().host() == "www.google.com") { |
| UMA_HISTOGRAM_SPARSE_SLOWLY("Net.ErrorCodesForHTTPSGoogleMainFrame2", |