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

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

Issue 2045303002: Update to Chromium //base at Chromium commit 3e81715e6d3a4324362635aea46ce1f1a163cca1. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/domokit/base@master
Patch Set: Created 4 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
Index: android/java/src/org/chromium/base/metrics/RecordHistogram.java
diff --git a/android/java/src/org/chromium/base/metrics/RecordHistogram.java b/android/java/src/org/chromium/base/metrics/RecordHistogram.java
index d94b9800abb0f50fb5e7363f8cb7c9eb87b21ce0..a47360e849108e9ec0fde16676be21f5d640948f 100644
--- a/android/java/src/org/chromium/base/metrics/RecordHistogram.java
+++ b/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);

Powered by Google App Engine
This is Rietveld 408576698