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

Side by Side Diff: net/http/http_stream_factory_impl.cc

Issue 2824513003: Add one more histogram to log how many Request are still pending when (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 unified diff | Download patch
« no previous file with comments | « no previous file | net/http/http_stream_factory_impl_job_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_stream_factory_impl.h" 5 #include "net/http/http_stream_factory_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <tuple> 8 #include <tuple>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 job_controller_set_.size() <= last_logged_job_controller_count_) { 365 job_controller_set_.size() <= last_logged_job_controller_count_) {
366 return; 366 return;
367 } 367 }
368 last_logged_job_controller_count_ = job_controller_set_.size(); 368 last_logged_job_controller_count_ = job_controller_set_.size();
369 369
370 UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfJobController", 370 UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfJobController",
371 job_controller_set_.size()); 371 job_controller_set_.size());
372 372
373 int alt_job_count = 0; 373 int alt_job_count = 0;
374 int main_job_count = 0; 374 int main_job_count = 0;
375 int pending_request_count = 0;
375 int preconnect_controller_count = 0; 376 int preconnect_controller_count = 0;
376 for (const auto& job_controller : job_controller_set_) { 377 for (const auto& job_controller : job_controller_set_) {
377 DCHECK(job_controller->HasPendingAltJob() || 378 DCHECK(job_controller->HasPendingAltJob() ||
378 job_controller->HasPendingMainJob()); 379 job_controller->HasPendingMainJob());
379 // For a preconnect controller, it should have exactly the main job. 380 // For a preconnect controller, it should have exactly the main job.
380 if (job_controller->is_preconnect()) { 381 if (job_controller->is_preconnect()) {
381 preconnect_controller_count++; 382 preconnect_controller_count++;
382 continue; 383 continue;
383 } 384 }
384 // For non-preconnects. 385 // For non-preconnects.
386 if (job_controller->HasPendingRequest())
387 pending_request_count++;
385 if (job_controller->HasPendingAltJob()) 388 if (job_controller->HasPendingAltJob())
386 alt_job_count++; 389 alt_job_count++;
387 if (job_controller->HasPendingMainJob()) 390 if (job_controller->HasPendingMainJob())
388 main_job_count++; 391 main_job_count++;
389 } 392 }
390 UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfPreconnect", 393 UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfPreconnect",
391 preconnect_controller_count); 394 preconnect_controller_count);
392 UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfNonPreconnectAltJob", 395 UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfNonPreconnectAltJob",
393 alt_job_count); 396 alt_job_count);
394 UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfNonPreconnectMainJob", 397 UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfNonPreconnectMainJob",
395 main_job_count); 398 main_job_count);
399 UMA_HISTOGRAM_COUNTS_1M("Net.JobControllerSet.CountOfPendingRequest",
Steven Holte 2017/04/14 22:46:44 It seems like 1M is much bigger than range of actu
400 pending_request_count);
396 } 401 }
397 402
398 void HttpStreamFactoryImpl::DumpMemoryStats( 403 void HttpStreamFactoryImpl::DumpMemoryStats(
399 base::trace_event::ProcessMemoryDump* pmd, 404 base::trace_event::ProcessMemoryDump* pmd,
400 const std::string& parent_absolute_name) const { 405 const std::string& parent_absolute_name) const {
401 if (job_controller_set_.empty()) 406 if (job_controller_set_.empty())
402 return; 407 return;
403 std::string name = 408 std::string name =
404 base::StringPrintf("%s/stream_factory", parent_absolute_name.c_str()); 409 base::StringPrintf("%s/stream_factory", parent_absolute_name.c_str());
405 base::trace_event::MemoryAllocatorDump* factory_dump = 410 base::trace_event::MemoryAllocatorDump* factory_dump =
(...skipping 29 matching lines...) Expand all
435 factory_dump->AddScalar("main_job_count", 440 factory_dump->AddScalar("main_job_count",
436 base::trace_event::MemoryAllocatorDump::kUnitsObjects, 441 base::trace_event::MemoryAllocatorDump::kUnitsObjects,
437 main_job_count); 442 main_job_count);
438 // The number of preconnect controllers. 443 // The number of preconnect controllers.
439 factory_dump->AddScalar("preconnect_count", 444 factory_dump->AddScalar("preconnect_count",
440 base::trace_event::MemoryAllocatorDump::kUnitsObjects, 445 base::trace_event::MemoryAllocatorDump::kUnitsObjects,
441 preconnect_controller_count); 446 preconnect_controller_count);
442 } 447 }
443 448
444 } // namespace net 449 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_stream_factory_impl_job_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698