Commit 185e5edc authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

Remove some prefetching histograms.

The histograms are being recorded in code that isn't used when the
network service is enabled. It was decided that these histograms see
little enough use that it was better to remove them, rather than make
them work with the network service.

In particular, the histograms are:
Net.Prefetch.TimeSpentPrefetchingFromCache
Net.Prefetch.TimeSpentPrefetchingFromNetwork
Net.Prefetch.TimeBeforeCancel
Net.LoadPrefetch.Pattern
Net.Prefetch.Pattern
Net.Prefetch.TimeSpentOnPrefetchHit

Bug: 859535
Change-Id: Idc85a43ce4a7b2c959c419401c422d17b07e35d3
Reviewed-on: https://chromium-review.googlesource.com/1122703
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarEgor Pasko <pasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572243}
parent a660e359
...@@ -818,7 +818,6 @@ void ResourceLoader::ResponseCompleted() { ...@@ -818,7 +818,6 @@ void ResourceLoader::ResponseCompleted() {
TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT);
DVLOG(1) << "ResponseCompleted: " << request_->url().spec(); DVLOG(1) << "ResponseCompleted: " << request_->url().spec();
RecordHistograms();
ScopedDeferral scoped_deferral(this, DEFERRED_FINISH); ScopedDeferral scoped_deferral(this, DEFERRED_FINISH);
handler_->OnResponseCompleted(request_->status(), handler_->OnResponseCompleted(request_->status(),
...@@ -831,57 +830,6 @@ void ResourceLoader::CallDidFinishLoading() { ...@@ -831,57 +830,6 @@ void ResourceLoader::CallDidFinishLoading() {
delegate_->DidFinishLoading(this); delegate_->DidFinishLoading(this);
} }
void ResourceLoader::RecordHistograms() {
if (request_->load_flags() & net::LOAD_PREFETCH) {
// Note that RESOURCE_TYPE_PREFETCH requests are a subset of
// net::LOAD_PREFETCH requests. In the histograms below, "Prefetch" means
// RESOURCE_TYPE_PREFETCH and "LoadPrefetch" means net::LOAD_PREFETCH.
bool is_resource_type_prefetch =
GetRequestInfo()->GetResourceType() == RESOURCE_TYPE_PREFETCH;
PrefetchStatus prefetch_status = STATUS_UNDEFINED;
TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time();
switch (request_->status().status()) {
case net::URLRequestStatus::SUCCESS:
if (request_->was_cached()) {
prefetch_status = request_->response_info().unused_since_prefetch
? STATUS_SUCCESS_ALREADY_PREFETCHED
: STATUS_SUCCESS_FROM_CACHE;
if (is_resource_type_prefetch) {
UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentPrefetchingFromCache",
total_time);
}
} else {
prefetch_status = STATUS_SUCCESS_FROM_NETWORK;
if (is_resource_type_prefetch) {
UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentPrefetchingFromNetwork",
total_time);
}
}
break;
case net::URLRequestStatus::CANCELED:
prefetch_status = STATUS_CANCELED;
if (is_resource_type_prefetch)
UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeBeforeCancel", total_time);
break;
case net::URLRequestStatus::IO_PENDING:
case net::URLRequestStatus::FAILED:
prefetch_status = STATUS_UNDEFINED;
break;
}
UMA_HISTOGRAM_ENUMERATION("Net.LoadPrefetch.Pattern", prefetch_status,
STATUS_MAX);
if (is_resource_type_prefetch) {
UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", prefetch_status,
STATUS_MAX);
}
} else if (request_->response_info().unused_since_prefetch) {
TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time();
UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time);
}
}
void ResourceLoader::SetRawResponseHeaders( void ResourceLoader::SetRawResponseHeaders(
scoped_refptr<const net::HttpResponseHeaders> headers) { scoped_refptr<const net::HttpResponseHeaders> headers) {
raw_response_headers_ = headers; raw_response_headers_ = headers;
......
...@@ -121,7 +121,6 @@ class CONTENT_EXPORT ResourceLoader : public net::URLRequest::Delegate, ...@@ -121,7 +121,6 @@ class CONTENT_EXPORT ResourceLoader : public net::URLRequest::Delegate,
void CompleteRead(int bytes_read); void CompleteRead(int bytes_read);
void ResponseCompleted(); void ResponseCompleted();
void CallDidFinishLoading(); void CallDidFinishLoading();
void RecordHistograms();
void SetRawResponseHeaders( void SetRawResponseHeaders(
scoped_refptr<const net::HttpResponseHeaders> headers); scoped_refptr<const net::HttpResponseHeaders> headers);
......
...@@ -51161,6 +51161,9 @@ uploading your change for review. ...@@ -51161,6 +51161,9 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="Net.LoadPrefetch.Pattern" enum="PrefetchStatus"> <histogram name="Net.LoadPrefetch.Pattern" enum="PrefetchStatus">
<obsolete>
Deprecated July 2018
</obsolete>
<owner>droger@chromium.org</owner> <owner>droger@chromium.org</owner>
<owner>mattcary@chromium.org</owner> <owner>mattcary@chromium.org</owner>
<owner>pasko@chromium.org</owner> <owner>pasko@chromium.org</owner>
...@@ -51662,6 +51665,9 @@ uploading your change for review. ...@@ -51662,6 +51665,9 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="Net.Prefetch.Pattern" enum="PrefetchStatus"> <histogram name="Net.Prefetch.Pattern" enum="PrefetchStatus">
<obsolete>
Deprecated July 2018
</obsolete>
<owner>jkarlin@chromium.org</owner> <owner>jkarlin@chromium.org</owner>
<summary> <summary>
The completion status of prefetches that have finished loading. The completion status of prefetches that have finished loading.
...@@ -51693,6 +51699,9 @@ uploading your change for review. ...@@ -51693,6 +51699,9 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="Net.Prefetch.TimeBeforeCancel" units="ms"> <histogram name="Net.Prefetch.TimeBeforeCancel" units="ms">
<obsolete>
Deprecated July 2018
</obsolete>
<owner>jkarlin@chromium.org</owner> <owner>jkarlin@chromium.org</owner>
<summary> <summary>
Time spent on prefetch requests before the request was canceled. Time spent on prefetch requests before the request was canceled.
...@@ -51703,6 +51712,9 @@ uploading your change for review. ...@@ -51703,6 +51712,9 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="Net.Prefetch.TimeSpentOnPrefetchHit" units="ms"> <histogram name="Net.Prefetch.TimeSpentOnPrefetchHit" units="ms">
<obsolete>
Deprecated July 2018
</obsolete>
<owner>jkarlin@chromium.org</owner> <owner>jkarlin@chromium.org</owner>
<summary> <summary>
Time spent on requests that were served from a cache entry whose Time spent on requests that were served from a cache entry whose
...@@ -51711,6 +51723,9 @@ uploading your change for review. ...@@ -51711,6 +51723,9 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="Net.Prefetch.TimeSpentPrefetchingFromCache" units="ms"> <histogram name="Net.Prefetch.TimeSpentPrefetchingFromCache" units="ms">
<obsolete>
Deprecated July 2018
</obsolete>
<owner>jkarlin@chromium.org</owner> <owner>jkarlin@chromium.org</owner>
<summary>Time spent on prefetch requests when fetched from cache.</summary> <summary>Time spent on prefetch requests when fetched from cache.</summary>
<details> <details>
...@@ -51719,6 +51734,9 @@ uploading your change for review. ...@@ -51719,6 +51734,9 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="Net.Prefetch.TimeSpentPrefetchingFromNetwork" units="ms"> <histogram name="Net.Prefetch.TimeSpentPrefetchingFromNetwork" units="ms">
<obsolete>
Deprecated July 2018
</obsolete>
<owner>jkarlin@chromium.org</owner> <owner>jkarlin@chromium.org</owner>
<summary> <summary>
Time spent on prefetch requests when fetched from the network, including Time spent on prefetch requests when fetched from the network, including
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