Merge "[TeX] Introduced Telemetry Express Logging APIs" am: e20937a727 am: 56788aad35
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2494505 Change-Id: I0a69a36d1aa340699facb99a5d325ef018bf7221 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -35,6 +35,16 @@ public final class Counter {
|
|||||||
logIncrement(metricId, 1);
|
logIncrement(metricId, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
* Increments Telemetry Express Counter metric by arbitrary value
|
||||||
* @param metricId to log, no-op if metricId is not defined in the TeX catalog
|
* @param metricId to log, no-op if metricId is not defined in the TeX catalog
|
||||||
@@ -45,4 +55,17 @@ public final class Counter {
|
|||||||
final long metricIdHash = Utils.hashString(metricId);
|
final long metricIdHash = Utils.hashString(metricId);
|
||||||
FrameworkStatsLog.write(FrameworkStatsLog.EXPRESS_EVENT_REPORTED, metricIdHash, amount);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user