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

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

Issue 1013463003: Update from https://crrev.com/320931 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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: 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 08c314f156eb8fa1ba4ef7386fd528099d386033..c1f6d36992cd91b4e53798d15252d53ca512f84f 100644
--- a/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java
+++ b/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java
@@ -43,6 +43,16 @@ public class RecordHistogram {
}
/**
+ * Records a sample in a count histogram of the given name. This is the Java equivalent of the
+ * UMA_HISTOGRAM_COUNTS C++ macro.
+ * @param name name of the histogram
+ * @param sample sample to be recorded, at least 1 and at most 999999
+ */
+ public static void recordCountHistogram(String name, int sample) {
+ nativeRecordCountHistogram(name, System.identityHashCode(name), sample);
+ }
+
+ /**
* Records a sample in a histogram of times. Useful for recording short durations. This is the
* Java equivalent of the UMA_HISTOGRAM_TIMES C++ macro.
* @param name name of the histogram
@@ -123,6 +133,7 @@ public class RecordHistogram {
private static native void nativeRecordBooleanHistogram(String name, int key, boolean sample);
private static native void nativeRecordEnumeratedHistogram(
String name, int key, int sample, int boundary);
+ private static native void nativeRecordCountHistogram(String name, int key, int sample);
private static native int nativeGetHistogramValueCountForTesting(String name, int sample);
private static native void nativeInitialize();

Powered by Google App Engine
This is Rietveld 408576698