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

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

Issue 1309143004: Add UMA metrics to record the size of internal memory available on a user's device when the Update … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix indent 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
« no previous file with comments | « no previous file | base/android/javatests/src/org/chromium/base/metrics/RecordHistogramTest.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 d94b9800abb0f50fb5e7363f8cb7c9eb87b21ce0..a47360e849108e9ec0fde16676be21f5d640948f 100644
--- a/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java
+++ b/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java
@@ -78,6 +78,21 @@ public class RecordHistogram {
}
/**
+ * Records a sample in a linear histogram. This is the Java equivalent for using
+ * base::LinearHistogram.
+ * @param name name of the histogram
+ * @param sample sample to be recorded, at least |min| and at most |max| - 1.
+ * @param min lower bound for expected sample values, should be at least 1.
+ * @param max upper bounds for expected sample values
+ * @param numBuckets the number of buckets
+ */
+ public static void recordLinearCountHistogram(
+ String name, int sample, int min, int max, int numBuckets) {
+ nativeRecordLinearCountHistogram(
+ name, System.identityHashCode(name), sample, min, max, numBuckets);
+ }
+
+ /**
* Records a sparse histogram. This is the Java equivalent of UMA_HISTOGRAM_SPARSE_SLOWLY.
* @param name name of the histogram
* @param sample sample to be recorded. All values of |sample| are valid, including negative
@@ -170,6 +185,8 @@ public class RecordHistogram {
String name, int key, int sample, int boundary);
private static native void nativeRecordCustomCountHistogram(
String name, int key, int sample, int min, int max, int numBuckets);
+ private static native void nativeRecordLinearCountHistogram(
+ String name, int key, int sample, int min, int max, int numBuckets);
private static native void nativeRecordSparseHistogram(String name, int key, int sample);
private static native int nativeGetHistogramValueCountForTesting(String name, int sample);
« no previous file with comments | « no previous file | base/android/javatests/src/org/chromium/base/metrics/RecordHistogramTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698