Loading core/java/com/android/internal/expresslog/Counter.java +3 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ public final class Counter { /** * Increments Telemetry Express Counter metric by 1 * @param metricId to log, no-op if metricId is not defined in the TeX catalog * @hide */ public static void logIncrement(@NonNull String metricId) { Loading @@ -36,6 +37,8 @@ public final class Counter { /** * Increments Telemetry Express Counter metric by arbitrary value * @param metricId to log, no-op if metricId is not defined in the TeX catalog * @param amount to increment counter * @hide */ public static void logIncrement(@NonNull String metricId, long amount) { Loading core/java/com/android/internal/expresslog/Histogram.java +20 −4 Original line number Diff line number Diff line Loading @@ -26,6 +26,12 @@ public final class Histogram { private final long mMetricIdHash; private final BinOptions mBinOptions; /** * Creates Histogram metric logging wrapper * @param metricId to log, logging will be no-op if metricId is not defined in the TeX catalog * @param binOptions to calculate bin index for samples * @hide */ public Histogram(@NonNull String metricId, @NonNull BinOptions binOptions) { mMetricIdHash = Utils.hashString(metricId); mBinOptions = binOptions; Loading @@ -33,7 +39,7 @@ public final class Histogram { /** * Logs increment sample count for automatically calculated bin * * @param sample value * @hide */ public void logSample(float sample) { Loading @@ -46,17 +52,16 @@ public final class Histogram { public interface BinOptions { /** * Returns bins count to be used by a histogram * * @return bins count used to initialize Options, including overflow & underflow bins * @hide */ int getBinsCount(); /** * @return zero based index * Calculates bin index for the input sample value * Returns bin index for the input sample value * index == 0 stands for underflow * index == getBinsCount() - 1 stands for overflow * @return zero based index * @hide */ int getBinForSample(float sample); Loading @@ -70,6 +75,17 @@ public final class Histogram { private final float mExclusiveMaxValue; private final float mBinSize; /** * Creates otpions for uniform (linear) sized bins * @param binCount amount of histogram bins. 2 bin indexes will be calculated * automatically to represent undeflow & overflow bins * @param minValue is included in the first bin, values less than minValue * go to underflow bin * @param exclusiveMaxValue is included in the overflow bucket. For accurate measure up to kMax, then exclusiveMaxValue * should be set to kMax + 1 * @hide */ public UniformOptions(int binCount, float minValue, float exclusiveMaxValue) { if (binCount < 1) { throw new IllegalArgumentException("Bin count should be positive number"); Loading Loading
core/java/com/android/internal/expresslog/Counter.java +3 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ public final class Counter { /** * Increments Telemetry Express Counter metric by 1 * @param metricId to log, no-op if metricId is not defined in the TeX catalog * @hide */ public static void logIncrement(@NonNull String metricId) { Loading @@ -36,6 +37,8 @@ public final class Counter { /** * Increments Telemetry Express Counter metric by arbitrary value * @param metricId to log, no-op if metricId is not defined in the TeX catalog * @param amount to increment counter * @hide */ public static void logIncrement(@NonNull String metricId, long amount) { Loading
core/java/com/android/internal/expresslog/Histogram.java +20 −4 Original line number Diff line number Diff line Loading @@ -26,6 +26,12 @@ public final class Histogram { private final long mMetricIdHash; private final BinOptions mBinOptions; /** * Creates Histogram metric logging wrapper * @param metricId to log, logging will be no-op if metricId is not defined in the TeX catalog * @param binOptions to calculate bin index for samples * @hide */ public Histogram(@NonNull String metricId, @NonNull BinOptions binOptions) { mMetricIdHash = Utils.hashString(metricId); mBinOptions = binOptions; Loading @@ -33,7 +39,7 @@ public final class Histogram { /** * Logs increment sample count for automatically calculated bin * * @param sample value * @hide */ public void logSample(float sample) { Loading @@ -46,17 +52,16 @@ public final class Histogram { public interface BinOptions { /** * Returns bins count to be used by a histogram * * @return bins count used to initialize Options, including overflow & underflow bins * @hide */ int getBinsCount(); /** * @return zero based index * Calculates bin index for the input sample value * Returns bin index for the input sample value * index == 0 stands for underflow * index == getBinsCount() - 1 stands for overflow * @return zero based index * @hide */ int getBinForSample(float sample); Loading @@ -70,6 +75,17 @@ public final class Histogram { private final float mExclusiveMaxValue; private final float mBinSize; /** * Creates otpions for uniform (linear) sized bins * @param binCount amount of histogram bins. 2 bin indexes will be calculated * automatically to represent undeflow & overflow bins * @param minValue is included in the first bin, values less than minValue * go to underflow bin * @param exclusiveMaxValue is included in the overflow bucket. For accurate measure up to kMax, then exclusiveMaxValue * should be set to kMax + 1 * @hide */ public UniformOptions(int binCount, float minValue, float exclusiveMaxValue) { if (binCount < 1) { throw new IllegalArgumentException("Bin count should be positive number"); Loading