Awhile back, I changed the enum histograms in two ways:
1. Allow UMA_HISTOGRAM_ENUMERATION to autodeduce the boundary value from Enumerator::kMaxValue.
2. Enabled clang enforcement that kMaxValue is correctly defined.
What I didn't realize is that Java also can record histograms:
https://cs.chromium.org/chromium/src/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java?rcl=fb7986d88b0b8f174020916003d6939d2d928b83&l=81
At first, I was just going to use reflection to figure out the max value, to prove such a thing is even viable. Unfortunately, since Java enums have a cost, we've chosen to just use ints with enumerated annotations (?).
We should try to figure out something for Java, because the current Java way is not very compatible with the kMaxValue definitions in C++ now. I'm not really a Java expert, so any thoughts from Java experts would be great.
Comment 1 by dcheng@chromium.org
, Oct 12