History log of /frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
427d372552490a2c5ac4041fe345b15f69451f57 22-Mar-2018 Yao Chen <yaochen@google.com> Support sliced condition change in GaugeMetric

TODO: We need CTS to verify the behavior.

Bug: 73958484
Test: statsd_test
Change-Id: I56406983ddede12bc6a2e12188693a0c51ccae5c
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
13fb7e4eeaf7aee408821afe7ee55a5167e49e59 08-Mar-2018 Yangster <yanglu@google.com> Statsd cpu optimizaton

- cache the changed dimensions in condition tracker.
- avoid query condition wizard when unnecessary.
- avoid copy dimension keys in condition key generation.

Test: statsd tests.

BUG: b/73959649
Change-Id: I17d68e2a82643de3f421309841e75f84c6fd8f43
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
8a8d16ceea1e5b7a2f8c41e17b5d993035f50f5d 08-Feb-2018 Yao Chen <yaochen@google.com> Statsd CPU optimization.

The key change is to revamp how we parse/store/match a log event, especially how we match repeated
field and attribution nodes, and how we construct dimensions and compare them.

+ We use a integer to encode the field of a log element. And also encode the FieldMatcher into an
integer and a bit mask. The log matching becomes 2 integer operations.

+ Dimension is stored as encoded field and value pair. Checking if 2 dimensions are equal is then
becoming checking if the underlying integers are equal. The integers are stored contiguously
in memory, so it's much faster than previous tree structure.

Start review from FieldValue.h

Test: statsd_test + new unit tests

Bug: 72659059

Change-Id: Iec8daeacdd3f39ab297c10ab9cd7b710a9c42e86
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
9369446f0b04945d6674550728ae81196d6fb5c2 23-Jan-2018 Yangster-mac <yanglu@google.com> Support dimension in condition in metric producers.

Test: added e2e tests for count/duration metrics sliced by fields in condition and with/without links.

Change-Id: Ie34deba68e6780abdde458be3f0ce5284e76a1a2
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
861795096296ebbe6d5b147519ad52a43b4b957c 24-Jan-2018 Yangster-mac <yanglu@google.com> Fix deadlock for write-disk cmd.

Test: manual tested.
Change-Id: I6c1e1f10bbb3830c932b3d7b57df8d4960c13977
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
94e197cceb2ba7df13ff8de04f60bfeec64015d9 03-Jan-2018 Yangster-mac <yanglu@google.com> 1/ Change all "name" to id in statsD.
2/ Handle Subscription for alert.
3/ Support no_report_metric

Bug: 69522276
Test: all statsd unit tests passed.
Change-Id: I851b235f2d149b8602b0cad632d5bf541962f40a
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
2087716f2bdca90c7c3034d556ac12911bd8018e 23-Dec-2017 Yangster-mac <yanglu@google.com> 1/ Support nested message and repeated fields in statsd.
2/ Filter gauge fields by FieldMatcher.
3/ Wire up wakelock attribution chain.
4/ e2e test: wakelock duration metric with aggregated predicate dimensions.
5/ e2e test: count metric with multiple metric condition links for 2 predicates and 1 non-sliced predicate.

Test: statsd unit test passed.

Change-Id: I89db31cb068184a54e0a892fad710966d3127bc9
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
3c0b95ceb520c6b23871da90c23f89c55b76b560 16-Dec-2017 Yao Chen <yaochen@google.com> Turn off verbose logging, remove the fake config.

Test: statsd_test & manual
Change-Id: I43068c8db006cbbeccacaa9d8426ab4d0394313a
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
12d01fa7c165a1f79091d4d742a48bffd7552650 05-Dec-2017 Stefan Lafon <stlafon@google.com> Rename more things in statsd_config.proto.

SimpleCondition -> SimplePredicate
simple_condition -> simple_predicate
Condition -> Predicate
condition -> predicate

Test: Ran statsd and statsd_test.

Change-Id: I3115fb51a4dc3cbe5f23535dfc448d5755b9ed7f
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
7c334a129e93e405a72e8299a1cd928af079d14f 22-Nov-2017 Yangster <yanglu@google.com> Make member function as const whenever possible.

Test: unit tests passed.
Change-Id: I751cabf305a4b5aa2095853cc951837da0df4c78
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
967b2051fe17fa3c38d248a556f8c4ff21a573a7 08-Nov-2017 Yao Chen <yaochen@google.com> Make SimpleCondition satisfactorily complicated.

+ Support nested counting
+ Support StopAll
+ Added default_condition to SimpleCondition config
+ Some refactoring/clean up
+ Added unit tests

Test: Added unit tests, statsd_test
Change-Id: I6564ac2e068ce6810e8090c0818064c625c7847a
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
5154a379303ab90a2b2914676a4441917a329b5d 31-Oct-2017 Yao Chen <yaochen@google.com> Adding multi layer aggregation in DurationMetric

Newly supported metrics examples:

1) Compute [Total|Max] duration of [an app] holding [ANY] wake lock while [this app] is in
[background] and [screen off], bucket size 30seconds, and slice output by uid.

2) Compute [Total|Max] duration of [ANY app] holding [ANY] wake lock while [this app] is in
[background] and [screen off], bucket size 30 seconds.

+ DurationMetric proto has a "what" which is a SimpleCondition. It defines the atom level start
and stop of the duration timer, and it has its atom dimension. e.g., for wake locks, the atom
dimensions wil be uid and wl name.

+ Now dimension is explicitly specified in SimpleCondition proto instead of inferred from the "link"

+ Added support for "Or" and "Max" through 2 layers of aggregation.

TODO: (1) The way we track slicedCondition in duration metric is not efficient. optimize!
(2) The output dimension should all use int32 instead of KeyMatcher. Fix in a future cl.

Test: Added some unit tests using gmock. Will add more unit tests.

Change-Id: I58a827624f01f9a54fcb80709c4de4ff94a8bc67
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
729093df0dd7d7038ad43b16ecdb59a1404f3b50 16-Oct-2017 Yao Chen <yaochen@google.com> Add support for dimension, and link with condition and added DurationMetric

Now we support following metrics:
<Duration> of [app holding a wake lock], while [*this app*] is [in background] [AND] [screen is off]
[Slice] the output by [app name, wake lock name], with bucket size [30sec]

+ Also added onDumpReport() api in MetricsManager, it can be called from client to fetch the data from
statsd

+ Also added command line tool to dump the StatsLogReport from all metrics for debugging.

+ Synced proto from google3. with a pending cl (cr/172359050)

TODO: We need to add tons of tests to test the Metrics. I will work on it after this CL so people
can be unblocked.

I locally test the duration metric with wake lock with an app that generates StatsLog events.

Test: statsd_test

and manual test, and run:

adb shell cmd stats dump-report
We have a default config, which contains a metrics to count PROCESS_START event sliced by
package name.

Change-Id: I4838cc6cf025c143b7e84f43040703a78121fd25
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
c4dfae56c10a1dd571baa78c750f2e68c919d74f 18-Oct-2017 Joe Onorato <joeo@google.com> Introduce a new wrapper for log_msg -- LogEvent

It stores all of the parsed fields in a single vector, and
provides accessor methods to get at fields by index with
their correct type.

Test: statsd_test
Change-Id: I4fa94e4ce52db3ac87f19b62f9c85398de6e8145
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
9fc9edf95a308f5884bf541cac81ce1f41aba0ba 16-Oct-2017 Joe Onorato <joeo@google.com> Clean up how we handle configurations, and other assorted cleanup

- Add a ConfigManager class that tracks the configurations
that have been passed to us. Configurations are now
tracked by tuples of (uid,tag), where the tag is an
app-defined string, in case a single uid has multiple
configurations.
- Move all of the initialization into StatsService.
- Get rid of the ability to have multiple LogListeners. Raw
events are now pushed directly into StatsService, which
can distribute them to the interested parties (and will
eventually be able to do the proper locking).
- Add Log.h, which sets our LOG_TAG correctly.
- Move some of the related files that I expect will grow some
into their own subdirectories.

Test: statsd_test
Test: adb shell cmd stats config ...
Test: adb shell dumpsys stats
Change-Id: I79487603003d8a842d5bd319741f1ecbf72063d1
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp
caf339d004fad667748b68912c254df4e75cdc5a 07-Oct-2017 Yao Chen <yaochen@google.com> More complete implementation for condition and log matchers in statsd.

+ also synced proto from google3 to fix the LogEntryMatcher proto

+ MetricsManager represents StatsdConfig, it's responsible for initializing and managing all
LogEntryMatcher, Condition, and Metrics. Start review from here.

+ Added more complete StatsdConfig initialization, including building the map for:
LogEntryMatcher -> Metrics
LogEntryMatcher -> Condition
Condition -> Metrics.

All the maps use index(int). The extra amount of memory for storing mappings help us
quickly process log events.

The StatsdConfig initialization process detects malformed config
- Circle dependency
- Missing definition
etc.

And once we detect ANY error, statsd will reject the config. And the resources related to this
config will be released.

Test: Added unit tests
Change-Id: I2c4aefdbf3e2aa1701eacbb2fb5e653819ec1fbb
/frameworks/base/cmds/statsd/src/condition/CombinationConditionTracker.cpp