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

Unified Diff: net/http/http_stream_factory_impl.cc

Issue 2809453002: Add JobController/Job count to UMA histograms when the count hits limit (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 13948e47fba48f91a2c6dada77722ef406a9ce9c..b20a062716c7d71d4e7b8f51e9781f1488edd6da 100644
--- a/net/http/http_stream_factory_impl.cc
+++ b/net/http/http_stream_factory_impl.cc
@@ -107,28 +107,7 @@ HttpStreamFactoryImpl::HttpStreamFactoryImpl(HttpNetworkSession* session,
HttpStreamFactoryImpl::~HttpStreamFactoryImpl() {
DCHECK(spdy_session_request_map_.empty());
- int alt_job_count = 0;
- int main_job_count = 0;
- int preconnect_controller_count = 0;
- for (const auto& it : job_controller_set_) {
- DCHECK(it->HasPendingAltJob() || it->HasPendingMainJob());
- // For a preconnect controller, it should have exactly the main job.
- if (it->is_preconnect()) {
- preconnect_controller_count++;
- continue;
- }
- // For non-preconnects.
- if (it->HasPendingAltJob())
- alt_job_count++;
- if (it->HasPendingMainJob())
- main_job_count++;
- }
- UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfPreconnect",
- preconnect_controller_count);
- UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfNonPreconnectAltJob",
- alt_job_count);
- UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfNonPreconnectMainJob",
- main_job_count);
+ AddJobControllerCountToHistograms();
}
HttpStreamRequest* HttpStreamFactoryImpl::RequestStream(
@@ -195,6 +174,8 @@ HttpStreamRequest* HttpStreamFactoryImpl::RequestStreamInternal(
bool enable_ip_based_pooling,
bool enable_alternative_services,
const NetLogWithSource& net_log) {
+ AddJobControllerCountToHistograms();
+
auto job_controller = base::MakeUnique<JobController>(
this, delegate, session_, job_factory_.get(), request_info,
/* is_preconnect = */ false, enable_ip_based_pooling,
@@ -211,6 +192,8 @@ HttpStreamRequest* HttpStreamFactoryImpl::RequestStreamInternal(
void HttpStreamFactoryImpl::PreconnectStreams(
int num_streams,
const HttpRequestInfo& request_info) {
+ AddJobControllerCountToHistograms();
+
SSLConfig server_ssl_config;
SSLConfig proxy_ssl_config;
session_->GetSSLConfig(request_info, &server_ssl_config, &proxy_ssl_config);
@@ -372,6 +355,31 @@ bool HttpStreamFactoryImpl::ProxyServerSupportsPriorities(
scheme_host_port);
}
+void HttpStreamFactoryImpl::AddJobControllerCountToHistograms() const {
+ int alt_job_count = 0;
+ int main_job_count = 0;
+ int preconnect_controller_count = 0;
+ for (const auto& it : job_controller_set_) {
Ryan Hamilton 2017/04/07 22:51:05 nit: I think "it" is not an iterator, but rather a
+ DCHECK(it->HasPendingAltJob() || it->HasPendingMainJob());
+ // For a preconnect controller, it should have exactly the main job.
+ if (it->is_preconnect()) {
+ preconnect_controller_count++;
+ continue;
+ }
+ // For non-preconnects.
+ if (it->HasPendingAltJob())
+ alt_job_count++;
+ if (it->HasPendingMainJob())
+ main_job_count++;
+ }
+ UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfPreconnect",
+ preconnect_controller_count);
+ UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfNonPreconnectAltJob",
+ alt_job_count);
+ UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfNonPreconnectMainJob",
+ main_job_count);
Ryan Hamilton 2017/04/07 22:51:05 it's a bit of a bummer that we have to compute the
Zhongyi Shi 2017/04/07 23:43:02 Well, if we want to improve: I guess one way we co
+}
+
void HttpStreamFactoryImpl::DumpMemoryStats(
base::trace_event::ProcessMemoryDump* pmd,
const std::string& parent_absolute_name) const {
« 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