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

Unified Diff: base/android/java/src/org/chromium/base/metrics/RecordHistogram.java

Issue 2477513004: android: Record the memory size of the GSA process. (Closed)
Patch Set: Address comments. Created 4 years, 1 month 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 | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/gsa/GSAServiceClient.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/gsa/GSAServiceClient.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698