Commit ded0021b authored by jkarlin's avatar jkarlin Committed by Commit bot

[HttpJob] Record bytes read for requests

This lets us see what request sizes look like over time and the percentage of bytes that come from the cache as opposed to the network.

BUG=669080

Review-Url: https://codereview.chromium.org/2548613003
Cr-Commit-Position: refs/heads/master@{#436302}
parent ed170221
...@@ -1485,12 +1485,25 @@ void URLRequestHttpJob::RecordPerfHistograms(CompletionCause reason) { ...@@ -1485,12 +1485,25 @@ void URLRequestHttpJob::RecordPerfHistograms(CompletionCause reason) {
total_time); total_time);
} }
} }
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.HttpJob.PrefilterBytesRead",
prefilter_bytes_read(), 1, 50000000, 50);
if (response_info_->was_cached) { if (response_info_->was_cached) {
UMA_HISTOGRAM_TIMES("Net.HttpJob.TotalTimeCached", total_time); UMA_HISTOGRAM_TIMES("Net.HttpJob.TotalTimeCached", total_time);
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.HttpJob.PrefilterBytesRead.Cache",
prefilter_bytes_read(), 1, 50000000, 50);
if (response_info_->unused_since_prefetch) if (response_info_->unused_since_prefetch)
UMA_HISTOGRAM_COUNTS("Net.Prefetch.HitBytes", prefilter_bytes_read()); UMA_HISTOGRAM_COUNTS("Net.Prefetch.HitBytes", prefilter_bytes_read());
} else { } else {
UMA_HISTOGRAM_TIMES("Net.HttpJob.TotalTimeNotCached", total_time); UMA_HISTOGRAM_TIMES("Net.HttpJob.TotalTimeNotCached", total_time);
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.HttpJob.PrefilterBytesRead.Net",
prefilter_bytes_read(), 1, 50000000, 50);
if (request_info_.load_flags & LOAD_PREFETCH) {
UMA_HISTOGRAM_COUNTS("Net.Prefetch.PrefilterBytesReadFromNetwork",
prefilter_bytes_read());
}
if (is_https_google) { if (is_https_google) {
if (used_quic) { if (used_quic) {
UMA_HISTOGRAM_MEDIUM_TIMES( UMA_HISTOGRAM_MEDIUM_TIMES(
...@@ -1503,10 +1516,6 @@ void URLRequestHttpJob::RecordPerfHistograms(CompletionCause reason) { ...@@ -1503,10 +1516,6 @@ void URLRequestHttpJob::RecordPerfHistograms(CompletionCause reason) {
} }
} }
if (request_info_.load_flags & LOAD_PREFETCH && !request_->was_cached())
UMA_HISTOGRAM_COUNTS("Net.Prefetch.PrefilterBytesReadFromNetwork",
prefilter_bytes_read());
start_time_ = base::TimeTicks(); start_time_ = base::TimeTicks();
} }
......
...@@ -31341,6 +31341,14 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. ...@@ -31341,6 +31341,14 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary> </summary>
</histogram> </histogram>
<histogram name="Net.HttpJob.PrefilterBytesRead" units="bytes">
<owner>jkarlin@chromium.org</owner>
<summary>
Total prefilter (e.g., before decompression) bytes read for an HttpJob
request.
</summary>
</histogram>
<histogram name="Net.HttpJob.TotalTime" units="ms"> <histogram name="Net.HttpJob.TotalTime" units="ms">
<owner>mmenke@chromium.org</owner> <owner>mmenke@chromium.org</owner>
<summary> <summary>
...@@ -109025,6 +109033,12 @@ value. ...@@ -109025,6 +109033,12 @@ value.
<affected-histogram name="HttpCache.PercentBeforeSend"/> <affected-histogram name="HttpCache.PercentBeforeSend"/>
</histogram_suffixes> </histogram_suffixes>
<histogram_suffixes name="HttpJobBytes" separator=".">
<suffix name="Cache" label="For requests served from the cache."/>
<suffix name="Net" label="For requests served from the network."/>
<affected-histogram name="Net.HttpJob.PrefilterBytesRead"/>
</histogram_suffixes>
<histogram_suffixes name="HttpPipeliningCompatibility"> <histogram_suffixes name="HttpPipeliningCompatibility">
<suffix name="disable_test" label="Do nothing"/> <suffix name="disable_test" label="Do nothing"/>
<suffix name="enable_test" label="Test connection for HTTP pipelining"/> <suffix name="enable_test" label="Test connection for HTTP pipelining"/>
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