Commit 4771dcb2 authored by Helen Li's avatar Helen Li Committed by Commit Bot

Adjust HttpStreamFactoryImpl::JobController UMA logging

The DCHECK is not valid after recent refactoring which makes JobController to
create jobs after proxy resolution (i.e. a JobController can have no pending
Job when it is in proxy resolution.)
UMA data show that having multiple hundreds of JobController is not indicative
of memory leak, so this CL also adjusts the threshold for emitting UMA stats.

Bug: 775253
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I5f12ee5c16de51a87aaf7dd2aed6840801b5367a
Reviewed-on: https://chromium-review.googlesource.com/743689Reviewed-by: default avatarZhongyi Shi <zhongyi@chromium.org>
Commit-Queue: Helen Li <xunjieli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512568}
parent a9f882c7
...@@ -246,9 +246,9 @@ bool HttpStreamFactoryImpl::ProxyServerSupportsPriorities( ...@@ -246,9 +246,9 @@ bool HttpStreamFactoryImpl::ProxyServerSupportsPriorities(
void HttpStreamFactoryImpl::AddJobControllerCountToHistograms() { void HttpStreamFactoryImpl::AddJobControllerCountToHistograms() {
// Only log the count of JobControllers when the count is hitting one of the // Only log the count of JobControllers when the count is hitting one of the
// boundaries for the first time which is a multiple of 100: 100, 200, 300, // boundaries for the first time which is a multiple of 1000: 1000, 2000,
// etc. // 3000, etc.
if (job_controller_set_.size() % 100 != 0 || if (job_controller_set_.size() % 1000 != 0 ||
job_controller_set_.size() <= last_logged_job_controller_count_) { job_controller_set_.size() <= last_logged_job_controller_count_) {
return; return;
} }
...@@ -260,12 +260,8 @@ void HttpStreamFactoryImpl::AddJobControllerCountToHistograms() { ...@@ -260,12 +260,8 @@ void HttpStreamFactoryImpl::AddJobControllerCountToHistograms() {
size_t num_controllers_with_request = 0; size_t num_controllers_with_request = 0;
size_t num_controllers_for_preconnect = 0; size_t num_controllers_for_preconnect = 0;
for (const auto& job_controller : job_controller_set_) { for (const auto& job_controller : job_controller_set_) {
DCHECK(job_controller->HasPendingAltJob() || // Additionally log the states of the jobs.
job_controller->HasPendingMainJob()); job_controller->LogHistograms();
// Additionally logs the states of the jobs if there are at least 500
// controllers, which suggests that there might be a leak.
if (job_controller_set_.size() >= 500)
job_controller->LogHistograms();
// For a preconnect controller, it should have exactly the main job. // For a preconnect controller, it should have exactly the main job.
if (job_controller->is_preconnect()) { if (job_controller->is_preconnect()) {
num_controllers_for_preconnect++; num_controllers_for_preconnect++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment