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

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: Address Ilya's comments 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..58887cc3a8f9a1a8c61ad26b3810e61427460de4 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(kModelTypeMemoryHistogramPrefix, processor->type_,
+ memory_usage);
+}
+
ModelTypeDebugInfo::ModelTypeDebugInfo() {}
// static

Powered by Google App Engine
This is Rietveld 408576698