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

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

Issue 2623383005: Log states of JobController in Net MemoryDumpProvider (Closed)
Patch Set: self review Created 3 years, 11 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
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 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "base/metrics/histogram_macros.h" 11 #include "base/metrics/histogram_macros.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/strings/stringprintf.h"
15 #include "base/trace_event/memory_allocator_dump.h"
16 #include "base/trace_event/process_memory_dump.h"
14 #include "net/http/http_network_session.h" 17 #include "net/http/http_network_session.h"
15 #include "net/http/http_server_properties.h" 18 #include "net/http/http_server_properties.h"
16 #include "net/http/http_stream_factory_impl_job.h" 19 #include "net/http/http_stream_factory_impl_job.h"
17 #include "net/http/http_stream_factory_impl_job_controller.h" 20 #include "net/http/http_stream_factory_impl_job_controller.h"
18 #include "net/http/http_stream_factory_impl_request.h" 21 #include "net/http/http_stream_factory_impl_request.h"
19 #include "net/http/transport_security_state.h" 22 #include "net/http/transport_security_state.h"
20 #include "net/proxy/proxy_info.h" 23 #include "net/proxy/proxy_info.h"
21 #include "net/quic/core/quic_server_id.h" 24 #include "net/quic/core/quic_server_id.h"
22 #include "net/spdy/bidirectional_stream_spdy_impl.h" 25 #include "net/spdy/bidirectional_stream_spdy_impl.h"
23 #include "net/spdy/spdy_http_stream.h" 26 #include "net/spdy/spdy_http_stream.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 HostPortPair host_port_pair = proxy_info.proxy_server().host_port_pair(); 298 HostPortPair host_port_pair = proxy_info.proxy_server().host_port_pair();
296 DCHECK(!host_port_pair.IsEmpty()); 299 DCHECK(!host_port_pair.IsEmpty());
297 300
298 url::SchemeHostPort scheme_host_port("https", host_port_pair.host(), 301 url::SchemeHostPort scheme_host_port("https", host_port_pair.host(),
299 host_port_pair.port()); 302 host_port_pair.port());
300 303
301 return session_->http_server_properties()->SupportsRequestPriority( 304 return session_->http_server_properties()->SupportsRequestPriority(
302 scheme_host_port); 305 scheme_host_port);
303 } 306 }
304 307
308 void HttpStreamFactoryImpl::DumpMemoryStats(
309 base::trace_event::ProcessMemoryDump* pmd,
310 const std::string& parent_absolute_name) const {
311 std::string name =
312 base::StringPrintf("%s/stream_factory", parent_absolute_name.c_str());
313 base::trace_event::MemoryAllocatorDump* factory =
ssid 2017/01/13 22:23:59 factory_dump? Not to confuse with the Factory obje
xunjieli 2017/01/17 17:51:24 Done.
314 pmd->CreateAllocatorDump(name);
315 factory->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount,
316 base::trace_event::MemoryAllocatorDump::kUnitsObjects,
317 job_controller_set_.size());
318 size_t alt_job_count = 0;
319 size_t preconnect_controller_count = 0;
320 for (const auto& it : job_controller_set_) {
321 if (it->HasPendingAltJob())
322 alt_job_count++;
Zhongyi Shi 2017/01/13 21:57:50 I thought we are trying to logging how many JobCon
xunjieli 2017/01/17 17:51:24 Great question. I think this was the goal while in
Zhongyi Shi 2017/01/18 04:56:21 The rationale makes sense to me, thanks for explai
xunjieli 2017/01/18 19:49:31 I didn't do a "pending main job count" is because
Zhongyi Shi 2017/01/18 20:17:45 It will be a good idea if you also do a pending ma
xunjieli 2017/01/18 20:25:20 Done. SGTM. PTAL?
323 if (it->is_preconnect())
324 preconnect_controller_count++;
325 }
326 factory->AddScalar("alt_job_count",
327 base::trace_event::MemoryAllocatorDump::kUnitsObjects,
328 alt_job_count);
329 factory->AddScalar("preconnect_count",
330 base::trace_event::MemoryAllocatorDump::kUnitsObjects,
331 preconnect_controller_count);
332 }
333
305 } // namespace net 334 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698