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

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: address #23 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') | tools/metrics/histograms/histograms.xml » ('j') | 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..cdb31094ad1e19bc635841c18423a931397f00f4 100644
--- a/net/http/http_stream_factory_impl.cc
+++ b/net/http/http_stream_factory_impl.cc
@@ -107,28 +107,8 @@ 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);
+ UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfJobControllerAtShutDown",
+ job_controller_set_.size());
}
HttpStreamRequest* HttpStreamFactoryImpl::RequestStream(
@@ -195,6 +175,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 +193,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 +356,40 @@ bool HttpStreamFactoryImpl::ProxyServerSupportsPriorities(
scheme_host_port);
}
+void HttpStreamFactoryImpl::AddJobControllerCountToHistograms() const {
+ // 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)
+ return;
+
+ UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfJobController",
+ job_controller_set_.size());
+
+ int alt_job_count = 0;
+ int main_job_count = 0;
+ int preconnect_controller_count = 0;
+ for (const auto& job_controller : job_controller_set_) {
+ DCHECK(job_controller->HasPendingAltJob() ||
+ job_controller->HasPendingMainJob());
+ // For a preconnect controller, it should have exactly the main job.
+ if (job_controller->is_preconnect()) {
+ preconnect_controller_count++;
+ continue;
+ }
+ // For non-preconnects.
+ if (job_controller->HasPendingAltJob())
+ alt_job_count++;
+ if (job_controller->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);
+}
+
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') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698