diff options
| author | 2023-03-21 02:38:55 +0000 | |
|---|---|---|
| committer | 2023-03-21 02:38:55 +0000 | |
| commit | 6816b082eb1d9e5b85fbca5878455d6df2bae04a (patch) | |
| tree | 9062abafd55cb52bb1239b2cd0a5ee5fefcd212f | |
| parent | baaa2bf3575d79f157b73b6019b322e0f6523267 (diff) | |
| parent | 44a98e2ab1043cabad04564777faee89b85d8682 (diff) | |
Merge "[TeX] Introduced Telemetry Express Logging APIs" am: e20937a727 am: 56788aad35 am: 44a98e2ab1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2494505
Change-Id: I3cb542b475e23a98d4fd693b1476b55baccf2086
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | core/java/com/android/internal/expresslog/Counter.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/core/java/com/android/internal/expresslog/Counter.java b/core/java/com/android/internal/expresslog/Counter.java index afdbdc8ead73..4a46d91efbf0 100644 --- a/core/java/com/android/internal/expresslog/Counter.java +++ b/core/java/com/android/internal/expresslog/Counter.java @@ -36,6 +36,16 @@ 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 + * @param uid used as a dimension for the count metric + * @hide + */ + public static void logIncrementWithUid(@NonNull String metricId, int uid) { + logIncrementWithUid(metricId, uid, 1); + } + + /** * 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 @@ -45,4 +55,17 @@ public final class Counter { final long metricIdHash = Utils.hashString(metricId); FrameworkStatsLog.write(FrameworkStatsLog.EXPRESS_EVENT_REPORTED, metricIdHash, amount); } + + /** + * Increments Telemetry Express Counter metric by arbitrary value + * @param metricId to log, no-op if metricId is not defined in the TeX catalog + * @param uid used as a dimension for the count metric + * @param amount to increment counter + * @hide + */ + public static void logIncrementWithUid(@NonNull String metricId, int uid, long amount) { + final long metricIdHash = Utils.hashString(metricId); + FrameworkStatsLog.write( + FrameworkStatsLog.EXPRESS_UID_EVENT_REPORTED, metricIdHash, amount, uid); + } } |