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

Unified Diff: components/sync/base/data_type_histogram.h

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
« no previous file with comments | « components/browser_sync/profile_sync_service.cc ('k') | components/sync/base/data_type_histogram.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/base/data_type_histogram.h
diff --git a/components/sync/base/data_type_histogram.h b/components/sync/base/data_type_histogram.h
index 642c8848cc8dd3aebc42a3084d3ebf75eb3b9cba..09cc6f3e0c41c868e2749e4bc19b5d8e8f6ec7c8 100644
--- a/components/sync/base/data_type_histogram.h
+++ b/components/sync/base/data_type_histogram.h
@@ -11,12 +11,21 @@
#include "base/time/time.h"
#include "components/sync/base/model_type.h"
+// Prefix for histogram recording datatype's memory usage.
+extern const char kModelTypeMemoryHistogramPrefix[];
+
// This function adds |value| to |sample| bucket of histogram |name|. |value|
// should be greater or equal to 1 and |name| can be variable. DataTypes are
// mapped to proper |sample| bucket by using ModelTypeToHistogramInt() function.
// So different DataTypes play the role of different buckets in this histogram.
void SyncRecordDatatypeBin(const std::string& name, int sample, int value);
+// Converts memory size |value| into kilobytes and records it into |model_type|
+// related histogram with prefix |histogram_name_prefix|.
+void SyncRecordMemoryKbHistogram(const std::string& histogram_name_prefix,
+ syncer::ModelType model_type,
+ size_t value);
+
// For now, this just implements UMA_HISTOGRAM_LONG_TIMES. This can be adjusted
// if we feel the min, max, or bucket count amount are not appropriate.
#define SYNC_FREQ_HISTOGRAM(name, time) \
« no previous file with comments | « components/browser_sync/profile_sync_service.cc ('k') | components/sync/base/data_type_histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698