Commit fa079fd2 authored by Randy Smith's avatar Randy Smith Committed by Commit Bot

Add successful request time histograms for both main frame and subresource loads.

Bug: None
Change-Id: I836fb3f2b238bc4d0e5cd1801452ee26027d4465
Reviewed-on: https://chromium-review.googlesource.com/800950Reviewed-by: default avatarCharlie Harrison <csharrison@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520767}
parent 53f4b0b8
......@@ -664,6 +664,9 @@ void ResourceDispatcherHostImpl::DidReceiveResponse(
void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) {
ResourceRequestInfoImpl* info = loader->GetRequestInfo();
base::TimeDelta request_loading_time(base::TimeTicks::Now() -
loader->request()->creation_time());
// Record final result of all resource loads.
if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) {
// This enumeration has "3" appended to its name to distinguish it from
......@@ -671,6 +674,10 @@ void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) {
UMA_HISTOGRAM_SPARSE_SLOWLY(
"Net.ErrorCodesForMainFrame3",
-loader->request()->status().error());
if (loader->request()->status().error() == net::OK) {
UMA_HISTOGRAM_LONG_TIMES("Net.RequestTime2Success.MainFrame",
request_loading_time);
}
if (loader->request()->status().error() == net::ERR_ABORTED) {
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.ErrAborted.SentBytes",
loader->request()->GetTotalSentBytes(), 1,
......@@ -699,6 +706,10 @@ void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) {
"Net.CertificateTransparency.MainFrameValidSCTCount", num_valid_scts);
}
} else {
if (loader->request()->status().error() == net::OK) {
UMA_HISTOGRAM_LONG_TIMES("Net.RequestTime2Success.Subresource",
request_loading_time);
}
if (info->GetResourceType() == RESOURCE_TYPE_IMAGE) {
UMA_HISTOGRAM_SPARSE_SLOWLY(
"Net.ErrorCodesForImages",
......
......@@ -45733,6 +45733,22 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>
<histogram name="Net.RequestTime2Success.MainFrame">
<owner>csharrison@chromium.org</owner>
<summary>
The amount of time between request initiation and request completion for
success for main frame resources.
</summary>
</histogram>
<histogram name="Net.RequestTime2Success.Subresource">
<owner>csharrison@chromium.org</owner>
<summary>
The amount of time between request initiation and request completion for
success for non-main frame resources.
</summary>
</histogram>
<histogram name="Net.ResourceDispatcherHost.OutstandingRequests.PerProcess"
units="requests">
<owner>xunjieli@chromium.org</owner>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment