summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrdsmith <rdsmith@chromium.org>2015-05-14 09:36:42 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-14 16:37:23 +0000
commit8b7c064122b1d0a28718672a44bcaea99f0d4d91 (patch)
treefc0154b4efec2942e64210e50ac7faa8c295b467
parent50fb5bbcda74bd2bb7428f82a97f2c43a9ef9690 (diff)
downloadchromium_src-8b7c064122b1d0a28718672a44bcaea99f0d4d91.zip
chromium_src-8b7c064122b1d0a28718672a44bcaea99f0d4d91.tar.gz
chromium_src-8b7c064122b1d0a28718672a44bcaea99f0d4d91.tar.bz2
Create histograms to track time-to-error values for different errors.
This is only done for main frame loads (so that it matches the behavior of Net.ErrorCodesForMainFrame3), and is done for the dominant errors seen in the wild. It also includes successful loads (for comparison) and all non-dominant errors in a final bucket (for completeness). BUG= 487663 R=mmenke@chromium.org R=jkarlin@chromium.org Review URL: https://codereview.chromium.org/1127383009 Cr-Commit-Position: refs/heads/master@{#329858}
-rw-r--r--content/browser/loader/resource_dispatcher_host_impl.cc42
-rw-r--r--tools/metrics/histograms/histograms.xml20
2 files changed, 61 insertions, 1 deletions
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index d758f68..9828244 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -19,11 +19,12 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/shared_memory.h"
#include "base/message_loop/message_loop.h"
-#include "base/metrics/histogram.h"
+#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
#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);
+ 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",
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index f5da3bf..a679a18 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -21369,6 +21369,14 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>
+<histogram name="Net.RequestTime">
+ <owner>rdsmith@chromium.org</owner>
+ <summary>
+ The amount of time between request initiation and request completion for
+ success and various different errors.
+ </summary>
+</histogram>
+
<histogram name="Net.ResourceLoader.ReadDeferral" units="milliseconds">
<owner>clamy@chromium.org</owner>
<summary>
@@ -68765,6 +68773,18 @@ To add a new entry, add it with any value and run test to compute valid value.
<affected-histogram name="Net.QuicDiskCache.FailureReason"/>
</histogram_suffixes>
+<histogram_suffixes name="NetRequestTime" separator=".">
+ <suffix name="ErrAborted" label="Request aborted"/>
+ <suffix name="ErrConnectionReset" label="Connection reset"/>
+ <suffix name="ErrConnectionTimedOut" label="Request connection timed out"/>
+ <suffix name="ErrInternetDisconnected" label="Internet disconnected"/>
+ <suffix name="ErrNameNotResolved" label="Request domain not resolved"/>
+ <suffix name="ErrTimedOut" label="Request timed out"/>
+ <suffix name="MiscError" label="Uncategorized error"/>
+ <suffix name="Success" label="Success"/>
+ <affected-histogram name="Net.RequestTime"/>
+</histogram_suffixes>
+
<histogram_suffixes name="NetworkErrors" separator=".">
<suffix name="AuthExtTimeout" label="with the last error AuthExtTimeout"/>
<suffix name="Offline" label="with the last error Offline"/>