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

Unified Diff: sync/util/data_type_histogram.h

Issue 1273303002: Measuring data use of different ModelTypes in Sync Service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@NewServices
Patch Set: Updating some of the comments Created 5 years, 4 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: sync/util/data_type_histogram.h
diff --git a/sync/util/data_type_histogram.h b/sync/util/data_type_histogram.h
index 0f7e6a99e594fb5d678ae8a4d4a3a875a3dc3584..bd8c202303a0ed1472fcdd58b91b1d644d64e3a3 100644
--- a/sync/util/data_type_histogram.h
+++ b/sync/util/data_type_histogram.h
@@ -6,9 +6,19 @@
#define SYNC_UTIL_DATA_TYPE_HISTOGRAM_H_
#include "base/metrics/histogram.h"
+#include "base/metrics/sparse_histogram.h"
#include "base/time/time.h"
#include "sync/internal_api/public/base/model_type.h"
+// This macro adds |value| to |sample| bucket of histogram |name|. |value|
+// should be greater or equal to 1 and |name| can be variable.
+#define UMA_HISTOGRAM_SPARSE_SLOWLY_WITH_VALUE(name, sample, value) \
Nicolas Zea 2015/08/18 21:55:18 I think it would be better to prefix this with SYN
amohammadkhan 2015/08/19 17:33:36 Done.
+ do { \
+ base::HistogramBase* histogram = base::SparseHistogram::FactoryGet( \
+ name, base::HistogramBase::kUmaTargetedHistogramFlag); \
+ histogram->AddCount(sample, value); \
+ } while (0)
+
// 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) UMA_HISTOGRAM_CUSTOM_TIMES( \

Powered by Google App Engine
This is Rietveld 408576698