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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2828733003: Add UMA for number of outstanding requests in ResourceDispatcherHostImpl (Closed)
Patch Set: Created 3 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index a9c9157800379d6417aed7d77b1a522fe829b111..cdaadd1d734d2412e648046a1552d15df34354c2 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -137,7 +137,7 @@ static ResourceDispatcherHostImpl* g_resource_dispatcher_host;
const int kUpdateLoadStatesIntervalMsec = 250;
// Maximum byte "cost" of all the outstanding requests for a renderer.
-// See delcaration of |max_outstanding_requests_cost_per_process_| for details.
+// See declaration of |max_outstanding_requests_cost_per_process_| for details.
// This bound is 25MB, which allows for around 6000 outstanding requests.
const int kMaxOutstandingRequestsCostPerProcess = 26214400;
@@ -350,6 +350,8 @@ ResourceDispatcherHostImpl::ResourceDispatcherHostImpl(
max_num_in_flight_requests_ * kMaxRequestsPerProcessRatio)),
max_outstanding_requests_cost_per_process_(
kMaxOutstandingRequestsCostPerProcess),
+ largest_outstanding_request_count_seen_(0),
+ largest_outstanding_request_per_process_count_seen_(0),
delegate_(nullptr),
loader_delegate_(nullptr),
allow_cross_origin_auth_prompt_(false),
@@ -1904,6 +1906,20 @@ ResourceDispatcherHostImpl::IncrementOutstandingRequestsCount(
DCHECK_GE(stats.num_requests, 0);
UpdateOutstandingRequestsStats(*info, stats);
+ if (num_in_flight_requests_ > largest_outstanding_request_count_seen_) {
Charlie Harrison 2017/04/19 23:08:28 I wonder if this would be better logged in Shutdow
xunjieli 2017/04/20 13:34:11 Similar to crbug.com/704988, Chrome on Android nev
Charlie Harrison 2017/04/20 13:39:16 OK, this LGTM but it would be preferable to hook i
xunjieli 2017/04/20 20:06:08 Acknowledged. I didn't find a way to hook it up wi
Charlie Harrison 2017/04/20 20:09:14 One possible way to implement it would be to pull
xunjieli 2017/04/20 20:14:15 Acknowledged. Thanks.
+ largest_outstanding_request_count_seen_ = num_in_flight_requests_;
+ UMA_HISTOGRAM_COUNTS_1M(
+ "Net.ResourceDispatcherHost.OutstandingRequests.Total",
+ largest_outstanding_request_count_seen_);
+ }
+
+ if (stats.num_requests > largest_outstanding_request_count_seen_) {
+ largest_outstanding_request_per_process_count_seen_ = stats.num_requests;
+ UMA_HISTOGRAM_COUNTS_1M(
+ "Net.ResourceDispatcherHost.OutstandingRequests.PerProcess",
+ largest_outstanding_request_per_process_count_seen_);
+ }
+
return stats;
}
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698