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

Unified Diff: components/sync/model/model_type_debug_info.cc

Issue 2950583003: [Sync] Record sync memory usage in histogram broken by datatypes (Closed)
Patch Set: Cleanup Created 3 years, 6 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: components/sync/model/model_type_debug_info.cc
diff --git a/components/sync/model/model_type_debug_info.cc b/components/sync/model/model_type_debug_info.cc
index f2f1dfdd09d9575b4855a6429a4ecbac136a67c8..0d1f6e3e3fb8b9cd8e12235d096e9b40fb87f14e 100644
--- a/components/sync/model/model_type_debug_info.cc
+++ b/components/sync/model/model_type_debug_info.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
+#include "components/sync/base/data_type_histogram.h"
#include "components/sync/model_impl/processor_entity_tracker.h"
#include "components/sync/protocol/proto_value_conversions.h"
@@ -59,6 +60,15 @@ void ModelTypeDebugInfo::GetStatusCounters(
}
}
+// static
+void ModelTypeDebugInfo::RecordMemoryUsageHistogram(
+ ModelTypeSyncBridge* bridge) {
+ SharedModelTypeProcessor* processor = GetProcessorFromBridge(bridge);
+ size_t memory_usage = processor->EstimateMemoryUsage();
+ SyncRecordMemoryKbHistogram("Sync.ModelTypeMemoryKB.", processor->type_,
+ memory_usage / 1024);
+}
+
ModelTypeDebugInfo::ModelTypeDebugInfo() {}
// static

Powered by Google App Engine
This is Rietveld 408576698