Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: net/url_request/url_request_http_job.cc

Issue 2548613003: [HttpJob] Record bytes read for requests (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 UMA_HISTOGRAM_MEDIUM_TIMES( 1495 UMA_HISTOGRAM_MEDIUM_TIMES(
1496 "Net.HttpJob.TotalTimeNotCached.Secure.Quic", total_time); 1496 "Net.HttpJob.TotalTimeNotCached.Secure.Quic", total_time);
1497 } else { 1497 } else {
1498 UMA_HISTOGRAM_MEDIUM_TIMES( 1498 UMA_HISTOGRAM_MEDIUM_TIMES(
1499 "Net.HttpJob.TotalTimeNotCached.Secure.NotQuic", total_time); 1499 "Net.HttpJob.TotalTimeNotCached.Secure.NotQuic", total_time);
1500 } 1500 }
1501 } 1501 }
1502 } 1502 }
1503 } 1503 }
1504 1504
1505 if (request_info_.load_flags & LOAD_PREFETCH && !request_->was_cached()) 1505 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.HttpJob.PrefilterBytesRead",
1506 UMA_HISTOGRAM_COUNTS("Net.Prefetch.PrefilterBytesReadFromNetwork", 1506 prefilter_bytes_read(), 1, 50000000, 50);
1507 prefilter_bytes_read()); 1507
1508 if (request_->was_cached()) {
mmenke 2016/12/02 14:58:49 Can we just grab this from response_info_ instead?
jkarlin 2016/12/02 15:06:23 Done.
1509 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.HttpJob.PrefilterBytesRead.Cache",
1510 prefilter_bytes_read(), 1, 50000000, 50);
1511 } else {
1512 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.HttpJob.PrefilterBytesRead.Net",
1513 prefilter_bytes_read(), 1, 50000000, 50);
1514
1515 if (request_info_.load_flags & LOAD_PREFETCH) {
1516 UMA_HISTOGRAM_COUNTS("Net.Prefetch.PrefilterBytesReadFromNetwork",
1517 prefilter_bytes_read());
1518 }
1519 }
1508 1520
1509 start_time_ = base::TimeTicks(); 1521 start_time_ = base::TimeTicks();
1510 } 1522 }
1511 1523
1512 void URLRequestHttpJob::DoneWithRequest(CompletionCause reason) { 1524 void URLRequestHttpJob::DoneWithRequest(CompletionCause reason) {
1513 if (done_) 1525 if (done_)
1514 return; 1526 return;
1515 done_ = true; 1527 done_ = true;
1516 1528
1517 // Notify NetworkQualityEstimator. 1529 // Notify NetworkQualityEstimator.
(...skipping 20 matching lines...) Expand all
1538 awaiting_callback_ = false; 1550 awaiting_callback_ = false;
1539 1551
1540 // Notify NetworkQualityEstimator. 1552 // Notify NetworkQualityEstimator.
1541 NetworkQualityEstimator* network_quality_estimator = 1553 NetworkQualityEstimator* network_quality_estimator =
1542 request()->context()->network_quality_estimator(); 1554 request()->context()->network_quality_estimator();
1543 if (network_quality_estimator) 1555 if (network_quality_estimator)
1544 network_quality_estimator->NotifyURLRequestDestroyed(*request()); 1556 network_quality_estimator->NotifyURLRequestDestroyed(*request());
1545 } 1557 }
1546 1558
1547 } // namespace net 1559 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698