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

Unified Diff: net/http/http_stream_factory_impl.cc

Issue 2815153002: Only log the job controller count when it's hitting boundaries for the first time (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 | « net/http/http_stream_factory_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl.cc
diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc
index cdb31094ad1e19bc635841c18423a931397f00f4..de7e5199a71ecca1f3b1c16b8f7b0d144d364ec8 100644
--- a/net/http/http_stream_factory_impl.cc
+++ b/net/http/http_stream_factory_impl.cc
@@ -103,7 +103,8 @@ HttpStreamFactoryImpl::HttpStreamFactoryImpl(HttpNetworkSession* session,
bool for_websockets)
: session_(session),
job_factory_(new DefaultJobFactory()),
- for_websockets_(for_websockets) {}
+ for_websockets_(for_websockets),
+ last_logged_job_controller_count_(0) {}
HttpStreamFactoryImpl::~HttpStreamFactoryImpl() {
DCHECK(spdy_session_request_map_.empty());
@@ -356,11 +357,14 @@ bool HttpStreamFactoryImpl::ProxyServerSupportsPriorities(
scheme_host_port);
}
-void HttpStreamFactoryImpl::AddJobControllerCountToHistograms() const {
+void HttpStreamFactoryImpl::AddJobControllerCountToHistograms() {
// Only log the count of JobControllers when the count is hitting one of the
- // boundaries which is a multiple of 100: 100, 200, 300, etc.
- if (job_controller_set_.size() < 100 || job_controller_set_.size() % 100 != 0)
+ // boundaries for the first time which is a multiple of 100: 100, 200, 300,
+ // etc.
+ if (job_controller_set_.size() % 100 != 0 ||
+ job_controller_set_.size() <= last_logged_job_controller_count_)
return;
Ryan Hamilton 2017/04/12 21:05:53 nit: now that the predicate is more than one line,
Zhongyi Shi 2017/04/12 21:18:04 Done.
+ last_logged_job_controller_count_ = job_controller_set_.size();
UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfJobController",
job_controller_set_.size());
« no previous file with comments | « net/http/http_stream_factory_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698