Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d94d7f6e authored by Vova Sharaienko's avatar Vova Sharaienko
Browse files

[TeX] Introduced Telemetry Express Logging APIs

- provided C++ Counter metric logging API with UID

Bug: 262791247
Test: m
Change-Id: I438bccc9e096ce3c0d7f6cdcb70e787b6ef44983
parent 3feefa8b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -28,5 +28,10 @@ void Counter::logIncrement(const char* metricName, int64_t amount) {
    stats_write(EXPRESS_EVENT_REPORTED, metricIdHash, amount);
}

void Counter::logIncrementWithUid(const char* metricName, int32_t uid, int64_t amount) {
    const int64_t metricIdHash = farmhash::Fingerprint64(metricName, strlen(metricName));
    stats_write(EXPRESS_UID_EVENT_REPORTED, metricIdHash, amount, uid);
}

}  // namespace expresslog
}  // namespace android
+2 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ namespace expresslog {
class Counter final {
public:
    static void logIncrement(const char* metricId, int64_t amount = 1);

    static void logIncrementWithUid(const char* metricId, int32_t uid, int64_t amount = 1);
};

}  // namespace expresslog