summaryrefslogtreecommitdiffstats
path: root/logd
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2015-12-07 19:30:51 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-12-07 19:30:51 +0000
commit2e2d2edc59244e56f93f1e7746ebc5e1ef5ea775 (patch)
tree0fc9c49151eac5fead08285343a5162937f98ad8 /logd
parent8ca9a775f7d8a5db68c7b42ec42aad969bd6d5e3 (diff)
parentf33657da4da403e32c79ff1fba4a496f231c3775 (diff)
downloadcore-2e2d2edc59244e56f93f1e7746ebc5e1ef5ea775.tar.gz
core-2e2d2edc59244e56f93f1e7746ebc5e1ef5ea775.tar.bz2
core-2e2d2edc59244e56f93f1e7746ebc5e1ef5ea775.zip
Merge "logd: test: statistics report chatty effective percentage"
Diffstat (limited to 'logd')
-rw-r--r--logd/tests/logd_test.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/logd/tests/logd_test.cpp b/logd/tests/logd_test.cpp
index 44fa95c9f..9ac80cf1c 100644
--- a/logd/tests/logd_test.cpp
+++ b/logd/tests/logd_test.cpp
@@ -112,18 +112,38 @@ static char *find_benchmark_spam(char *cp)
++cp;
}
benchmark = cp;
+#ifdef DEBUG
+ char *end = strstr(benchmark, "\n");
+ if (end == NULL) {
+ end = benchmark + strlen(benchmark);
+ }
+ fprintf(stderr, "parse for spam counter in \"%.*s\"\n",
+ (int)(end - benchmark), benchmark);
+#endif
+ // content
while (isdigit(*cp)) {
++cp;
}
while (isspace(*cp)) {
++cp;
}
+ // optional +/- field?
+ if ((*cp == '-') || (*cp == '+')) {
+ while (isdigit(*++cp) ||
+ (*cp == '.') || (*cp == '%') || (*cp == 'X')) {
+ ;
+ }
+ while (isspace(*cp)) {
+ ++cp;
+ }
+ }
+ // number of entries pruned
unsigned long value = 0;
while (isdigit(*cp)) {
value = value * 10ULL + *cp - '0';
++cp;
}
- if (value > 100000UL) {
+ if (value > 10UL) {
break;
}
benchmark = NULL;