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..2ede21e221db8d643f4899faae25b4e2222a9e83 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,45 @@ 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_CONNECTION_TIMED_OUT: |
| + UMA_HISTOGRAM_LONG_TIMES( |
| + "Net.RequestTime.ErrConnectionTimedOut", 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); |
|
jkarlin
2015/05/13 16:26:57
This doesn't have corresponding xml data.
Randy Smith (Not in Mondays)
2015/05/13 16:37:57
*rolls eyes at self* Fixed.
|
| + break; |
| + case net::ERR_TIMED_OUT: |
| + 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", |