Index: base/android/java/src/org/chromium/base/metrics/RecordHistogram.java |
diff --git a/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java b/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java |
index 7548fc5ecf65155a2cf2fb2d27cc10aa1c673dcd..609130f73a071c70e2e913791ad3dc8b0b0807a5 100644 |
--- a/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java |
+++ b/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java |
@@ -218,6 +218,19 @@ public class RecordHistogram { |
timeUnit.toMillis(min), timeUnit.toMillis(max), numBuckets); |
} |
+ /** |
+ * Records a sample in a histogram of sizes in KB. This is the Java equivalent of the |
+ * UMA_HISTOGRAM_MEMORY_KB C++ macro. |
+ * |
+ * Good for sizes up to about 500MB. |
+ * |
+ * @param name name of the histogram. |
+ * @param sizeInkB Sample to record in KB. |
+ */ |
+ public static void recordMemoryKBHistogram(String name, int sizeInKB) { |
+ recordCustomCountHistogram(name, sizeInKB, 1000, 500000, 50); |
+ } |
+ |
private static int clampToInt(long value) { |
if (value > Integer.MAX_VALUE) return Integer.MAX_VALUE; |
// Note: Clamping to MIN_VALUE rather than 0, to let base/ histograms code |