History log of /frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
15f6bbc24f4d7a3d4481d90a18df33d402ddacba 08-Apr-2018 Yangster-mac <yanglu@google.com> Flush the bucket when creating the metric producer.
Use int64 for value field.
E2e test for gauge/value metric.

BUG: b/74445671

Test: statsd test.
Change-Id: I823a0bade8f89834bdfb9cf48864852a47d7b63b
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
b142cc8add29c8c97f6134d35873d23db666027c 31-Mar-2018 Yangster-mac <yanglu@google.com> Statsd config TTL

Roughly check the config every hour to see whether the ttl expired.
If so, read the config from disk and recreate the metric manager.

Test: statsd test

BUG: b/77274363

Change-Id: I16838afe5bbe966c3a0f638869751f9b59a5a259
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
1a0a941c20eb746868d0de52e3806f69c74d335f 28-Mar-2018 Chenjie Yu <cjyu@google.com> Fix StatsCompanionService pull on bucket ends

+ change StatsPullerManager internal time units to be consistent
+ use series of alarms for pullers, instead of use setRepeating

Bug: 76223345
Bug: 75970648
Test: cts test
Change-Id: I9e6ac0ce06541f5ceabd2a8fa444e13d40e36983
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
d9afdee26f01d1e0277749959094d9f396799a69 27-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Support sliced condition change in GaugeMetric" into pi-dev
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/tests/metrics/GaugeMetricProducer_test.cpp
be10ddfe46ba6371bcd02cb57a06782e6b18d371 13-Mar-2018 Yangster-mac <yanglu@google.com> Flush the past buckets in anomaly tracker when time jumps forward

E2e test for count/duration anomaly trackers.

Test: new statsd tests.

BUG: b/74446029

Change-Id: Ia9be0240ba5021d44c1e1f096d67563e9138bb59
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
6bf9825b1575bfc3c62ef0a5129f94b6a776ef66 14-Mar-2018 Bookatz <bookatz@google.com> Statsd AnomalyDetection improvements

Various fixes and improvements to statsd's anomaly detection.

Bug: 74607818
Test: make statsd_test && adb sync data && adb shell data/nativetest64/statsd_test/statsd_test

Change-Id: Ia67a8eb6da0ea9293f698949e1565f7f024a7cb9
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
3f5ab3ff1d66e53c26e3a5951dc0804bca5467a8 13-Mar-2018 Bookatz <bookatz@google.com> Statsd: Remove storage of bucketNum

Past buckets had a field mBucketNum, storing the
"bucket number" they represented. Currently, the concept
of bucket number is used by Anomaly Detection (although this
may not be necessary), but these stored values are not used at all,
so removing them will save RAM.

Test: statsd tests still pass
Bug: 74607818
Change-Id: Iacc343bc39c5035f6e2f236c03de1d91606eff4c
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
932ececa1674c59a8da9f3e32d2651e781b86fc4 01-Feb-2018 Yangster-mac <yanglu@google.com> Alarm: wakes up statsd and notifies the subscribers.

Test: manually tested it.
Change-Id: Id796a68976aeb1611183023ba4e9c6a8b8c44bb8
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
db15052ae2ea34807644e2e97afa908e43ae59fd 15-Feb-2018 Howard Ro <yro@google.com> Merge "Add a guardrail to limit minimum bucket duration to be 5 minutes except when configured through adb command"
330af58f2b8582b855085655fae553cdfaf44e6c 09-Feb-2018 Yangster-mac <yanglu@google.com> Use elapsed realtime instead of times based on wall clock, which can jump around and go backwards.

Test: statsd unit test passed

Change-Id: Ib541df99231e171b3be2a24f75632693e36da90e
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
59cc24dbfda4148c1f5ef4de9c8763caa8672443 14-Feb-2018 yro <yro@google.com> Add a guardrail to limit minimum bucket duration to be 5 minutes except
when configured through adb command

Bug: 73287251
Test: statsd_test
Change-Id: Iee51fedbaabb2c1f534a6edef3c564da88ef658b
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.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/tests/metrics/GaugeMetricProducer_test.cpp
27785a8a4a684c831c18f7189a6fa1b98c3573e6 20-Jan-2018 David Chen <dwchen@google.com> Partial buckets on app upgrade and fix duration.

Statsd will create partial buckets in all metrics producers when an
app is upgraded so that we can separate metrics between different
versions of an app. By looking at the uid map changes, we can tell
which app versions belong to a bucket; for metrics that are not
affected by an app version, we can instead join the buckets together.

To simplify the logic, the ends of the full buckets are always
aligned to when the metric producers were created. These boundaries
are computed on the fly by using the bucket number and the metric
producers' start times.

We keep the anomaly trackers to only be given full buckets; we buffer
the partial buckets within each metric producer.

Duration metric's MAX_SPARSE is fixed to be implemented as such. In
addition, after further discussion, we find anomaly detection on
MAX_SPARSE to be unnecessary, so this functionality is removed.

Test: Unit-tests added and modified, passed on marlin-eng.
Change-Id: I5ff7a9c7f05c406e9faf400c6a39162970ded102
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.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/tests/metrics/GaugeMetricProducer_test.cpp
34ea1103a0faa0e01df0e2b0ac1ce98e7ec3e3f1 29-Jan-2018 Yangster-mac <yanglu@google.com> Extend gauge metric to support memory metric.

Test: statd unit test passed.

Test: statsd unit test passed
Change-Id: I2e3f26563678ae77d44afe168454b6d1ea449f3a
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
1bf94382d036fa8d61258205c5f4e18cd53cb61d 04-Jan-2018 Bookatz <bookatz@google.com> Anomaly detection is per dimension

Anomalies are now detected and declared per dimension. This means that
declareAnomaly now gets access to the key that is responsible for the
anomaly. Moreover, the refractory period is per dimension, not overall.
So a second anomaly for the same metric but a different dimension can
fire within the first dimension's refractory period. Thus, if app A
misbehaves and app B misbehaves shortly thereafter, they will both be
detected.

Eventually this key will be passed to the subscribers, although this cl
doesn't do anything with it.

Test: adb shell data/nativetest64/statsd_test/statsd_test
Change-Id: Id76856dc44fe9ecf91ac81a423e84f97c81d30ab
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
a070b6a40c95df5b64d195aba1386815fec5d5b7 04-Jan-2018 Yangster-mac <yanglu@google.com> Bug fix: gauge metric producer does not need the atom id parameter.

Test: statsd unit test passed
Change-Id: Ifd1e2f7a05a03886eb227ac1ae0e30b884e49f0c
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
b814481ad1f8d0e429d799b1571a6272e1a7f6c5 04-Jan-2018 Yangster-mac <yanglu@google.com> Use TimeUnit enum to specify the bucket size.

Test: all statsd unit test passed

Change-Id: I4f6b80ba2f8c984b06e46e6de6df3e546e99a968
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
a7fb12d2d285a3a62f5e8956d1bacfa0e15e9d0f 04-Jan-2018 Yangster-mac <yanglu@google.com> 1/ Use FieldMatcher to specify the value fields in value metric.
2/ rename number_of_buckets as num_buckets
3/ use double for the Alert's threshold

Test: statsd unit tests passed.
Change-Id: Id1f55f14d3712eddee561681e3cd77343f086c7a
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.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/tests/metrics/GaugeMetricProducer_test.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/tests/metrics/GaugeMetricProducer_test.cpp
857aaa520804d846a050e1eeb85d82977c983666 20-Dec-2017 Bookatz <bookatz@google.com> Splits AnomalyTracker into two files

Splits out DurationAnomalyTracker-specific functions into their own
subclass.

Test: the unit tests and CTS tests
Change-Id: Id6eb74d232b4a9c3a932d805d1ba3f0ba43a88b1
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
d5aa01b3716e07463019fa772f07a40613f9e39e 20-Dec-2017 Yao Chen <yaochen@google.com> Remove the hacky HashableDimensionKey.

+ Add a real HashableDimensionKey as a wrapper of the dimension.
So we can get rid of the maps that we kept.

Pay down technical debt and reduce memory usage.

Test: statsd_test & manual
Change-Id: I233280cf1e2ce93da6a8cd4e8514abb066f4016d
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
d9dfda76e0aa8b8aa4d2562a7ff4259f4500e355 12-Dec-2017 Chenjie Yu <cjyu@google.com> add feature: GaugeMetricProducer now takes repeated list of fields
bug fix: GaugeMetricProducer now works better with pulled events.
unit test also includes GaugeMetricProducer_test

Test: unit test
Change-Id: Ic60f09342d14cfb107be2130d445b323a56909e0
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
8f2f3d82053693b0dac828e848e2bb238e1db2d2 07-Dec-2017 Bookatz <bookatz@google.com> Anomaly Alert declarations in StatsdStats

StatsdStats now tracks the number of times an anomaly is detected (per
config, per alert name).

Also adds a configKey to AnomalyTracker, which is needed, not only for
statsdstats, but also (in the future) for reporting the header
information to incidentd.

Bug: 67978682
Test: adb shell data/nativetest64/statsd_test/statsd_test
Change-Id: Ib254db7e1edb4f0f193f4772d17f14934cdf7e30
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
f2bee6fec965fd42ab223f1a3aa705f07ba79aea 29-Nov-2017 Yangster <yanglu@google.com> 1/ Only expose thread-safe interfaces in metric producer.
2/ Simplify lock logic.
3/ Add test for duration metric producer.

Test: all unit test passsed.
Change-Id: If6ee2e69a17f12406f4b3ea3553b14642cd636d6
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
cc5adef2d0c5f96a225fd69517fd1eecb557f46d 21-Nov-2017 Bookatz <bookatz@google.com> Statsd anomaly detection - fixes

Fixes a few items in AnomalyTracker, especially to do with what happens
when an anomaly alarm fires.

Test: unit tests still pass
Change-Id: Ia89bd617442e952e587336b890c3ca67430b5e21
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp
e2cd6d509b17894b95d14523ae3e7c4c7a9a74e3 10-Nov-2017 Yangster-mac <yanglu@google.com> 1/ Duration anomaly tracker with alarm.
2/ Init anomaly from config based on the public language.
3/ Unit tests for anomaly detection in count/gauge producer.
4/ Revisit the duration tracker logic.

Test: unit test passed.
Change-Id: I2423c0e0f05b1e37626954de9e749303423963f2
/frameworks/base/cmds/statsd/tests/metrics/GaugeMetricProducer_test.cpp