Updates statsd atoms.proto with small changes.
Renames the apphook atom to be more descriptive. Renames time
suffixes to match more clear convention (ms and msec are ambiguous).
Adds a field to CPU active time that's required for the metrics
to be usable.
Test: Test that statsd can still build.
Change-Id: I94866510738db994e8d757260f30e599ba995dbd
diff --git a/cmds/statsd/src/StatsService.cpp b/cmds/statsd/src/StatsService.cpp
index ee38667..7ca125a 100644
--- a/cmds/statsd/src/StatsService.cpp
+++ b/cmds/statsd/src/StatsService.cpp
@@ -237,8 +237,8 @@
return cmd_write_data_to_disk(out);
}
- if (!args[0].compare(String8("log-app-hook"))) {
- return cmd_log_app_hook(out, args);
+ if (!args[0].compare(String8("log-app-breadcrumb"))) {
+ return cmd_log_app_breadcrumb(out, args);
}
if (!args[0].compare(String8("clear-puller-cache"))) {
@@ -281,8 +281,8 @@
fprintf(out, " Flushes all data on memory to disk.\n");
fprintf(out, "\n");
fprintf(out, "\n");
- fprintf(out, "usage: adb shell cmd stats log-app-hook [UID] LABEL STATE\n");
- fprintf(out, " Writes an AppHook event to the statslog buffer.\n");
+ fprintf(out, "usage: adb shell cmd stats log-app-breadcrumb [UID] LABEL STATE\n");
+ fprintf(out, " Writes an AppBreadcrumbReported event to the statslog buffer.\n");
fprintf(out, " UID The uid to use. It is only possible to pass a UID\n");
fprintf(out, " parameter on eng builds. If UID is omitted the calling\n");
fprintf(out, " uid is used.\n");
@@ -548,7 +548,7 @@
return NO_ERROR;
}
-status_t StatsService::cmd_log_app_hook(FILE* out, const Vector<String8>& args) {
+status_t StatsService::cmd_log_app_breadcrumb(FILE* out, const Vector<String8>& args) {
bool good = false;
int32_t uid;
int32_t label;
@@ -570,13 +570,13 @@
good = true;
} else {
fprintf(out,
- "Selecting a UID for writing AppHook can only be dumped for other UIDs on eng"
+ "Selecting a UID for writing Appbreadcrumb can only be dumped for other UIDs on eng"
" or userdebug builds.\n");
}
}
if (good) {
- fprintf(out, "Logging AppHook(%d, %d, %d) to statslog.\n", uid, label, state);
- android::util::stats_write(android::util::APP_HOOK, uid, label, state);
+ fprintf(out, "Logging AppBreadcrumbReported(%d, %d, %d) to statslog.\n", uid, label, state);
+ android::util::stats_write(android::util::APP_BREADCRUMB_REPORTED, uid, label, state);
} else {
print_cmd_help(out);
return UNKNOWN_ERROR;