Reduce statsd log data size.
1. Hash the strings in metric dimensions.
2. Optimize the timestamp encoding in bucket.
Use bucket num for full bucket and millis for
partial bucket.
3. Encode the dimension path per metric and avoid
deduping it across dimensons.
Test: statsd test
Change-Id: I18f69654de85edb21a9c835c73edead756295e05
BUG: b/77813755
diff --git a/cmds/statsd/src/FieldValue.cpp b/cmds/statsd/src/FieldValue.cpp
index dfd8705..f150f07 100644
--- a/cmds/statsd/src/FieldValue.cpp
+++ b/cmds/statsd/src/FieldValue.cpp
@@ -237,6 +237,18 @@
return false;
}
+bool HasPositionALL(const FieldMatcher& matcher) {
+ if (matcher.has_position() && matcher.position() == Position::ALL) {
+ return true;
+ }
+ for (const auto& child : matcher.child()) {
+ if (HasPositionALL(child)) {
+ return true;
+ }
+ }
+ return false;
+}
+
} // namespace statsd
} // namespace os
} // namespace android
\ No newline at end of file