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

Unified 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 side-by-side diff with in-line comments
Download patch
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 577a990853ae6ac0e4d83987152c46b7873ee019..17355e97e802ec438eaac5dbdd36361691faa919 100644
--- a/net/http/http_stream_factory_impl.cc
+++ b/net/http/http_stream_factory_impl.cc
@@ -11,6 +11,9 @@
#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
+#include "base/strings/stringprintf.h"
+#include "base/trace_event/memory_allocator_dump.h"
+#include "base/trace_event/process_memory_dump.h"
#include "net/http/http_network_session.h"
#include "net/http/http_server_properties.h"
#include "net/http/http_stream_factory_impl_job.h"
@@ -302,4 +305,30 @@ bool HttpStreamFactoryImpl::ProxyServerSupportsPriorities(
scheme_host_port);
}
+void HttpStreamFactoryImpl::DumpMemoryStats(
+ base::trace_event::ProcessMemoryDump* pmd,
+ const std::string& parent_absolute_name) const {
+ std::string name =
+ base::StringPrintf("%s/stream_factory", parent_absolute_name.c_str());
+ 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.
+ pmd->CreateAllocatorDump(name);
+ factory->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount,
+ base::trace_event::MemoryAllocatorDump::kUnitsObjects,
+ job_controller_set_.size());
+ size_t alt_job_count = 0;
+ size_t preconnect_controller_count = 0;
+ for (const auto& it : job_controller_set_) {
+ if (it->HasPendingAltJob())
+ 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?
+ if (it->is_preconnect())
+ preconnect_controller_count++;
+ }
+ factory->AddScalar("alt_job_count",
+ base::trace_event::MemoryAllocatorDump::kUnitsObjects,
+ alt_job_count);
+ factory->AddScalar("preconnect_count",
+ base::trace_event::MemoryAllocatorDump::kUnitsObjects,
+ preconnect_controller_count);
+}
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698