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

Unified Diff: components/sync/driver/directory_data_type_controller.cc

Issue 2949923004: Reland: [Sync] Record sync memory usage in histogram broken by datatypes (Closed)
Patch Set: Fix linker error 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/driver/directory_data_type_controller.cc
diff --git a/components/sync/driver/directory_data_type_controller.cc b/components/sync/driver/directory_data_type_controller.cc
index a03ee3dd17c026ff9ef07a88933505883b7e9674..3b2b879564ff7132e168625f6433b0529f12e44d 100644
--- a/components/sync/driver/directory_data_type_controller.cc
+++ b/components/sync/driver/directory_data_type_controller.cc
@@ -9,6 +9,7 @@
#include "base/memory/ptr_util.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "components/sync/base/data_type_histogram.h"
#include "components/sync/driver/sync_service.h"
#include "components/sync/engine/model_type_configurer.h"
#include "components/sync/syncable/syncable_read_transaction.h"
@@ -83,6 +84,14 @@ void DirectoryDataTypeController::GetStatusCounters(
callback.Run(type(), counters);
}
+void DirectoryDataTypeController::RecordMemoryUsageHistogram() {
+ syncer::syncable::Directory* directory =
+ sync_client_->GetSyncService()->GetUserShare()->directory.get();
+ size_t memory_usage = directory->EstimateMemoryUsageByType(type());
+ SyncRecordMemoryKbHistogram(kModelTypeMemoryHistogramPrefix, type(),
+ memory_usage);
+}
+
// static
std::unique_ptr<base::ListValue>
DirectoryDataTypeController::GetAllNodesForTypeFromDirectory(
« no previous file with comments | « components/sync/driver/directory_data_type_controller.h ('k') | components/sync/driver/model_type_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698