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

Unified Diff: net/http/http_stream_factory_impl.cc

Issue 2752193003: Add histograms to track the number of job controller and job that are (Closed)
Patch Set: address Alexei's comments Created 3 years, 9 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 | « no previous file | 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 0a742d1284204e4fcedf919df133dab72df2417f..07978753b28b3ff94f469456f143613d3e642190 100644
--- a/net/http/http_stream_factory_impl.cc
+++ b/net/http/http_stream_factory_impl.cc
@@ -104,6 +104,28 @@ HttpStreamFactoryImpl::HttpStreamFactoryImpl(HttpNetworkSession* session,
HttpStreamFactoryImpl::~HttpStreamFactoryImpl() {
DCHECK(request_map_.empty());
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);
}
HttpStreamRequest* HttpStreamFactoryImpl::RequestStream(
« 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