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
1. When an existing config is updated, remove the outdated config from
disk to stop accumulating configs.
2. Check disk to remove configs to make sure we delete lingering files
that does not live on memory.
Test: statsd, statsd_test, manual
Change-Id: Iedce4b6eb99a3d36bb5e1d1ccc0d88c84859e8f5
Added a malloc debug cmd to find memory leak and where
the most heap allocations are with backtrace.
More info: malloc_debug/README.md
The util class is borrowed from audio server.
Usage:
adb shell stop
adb shell setprop libc.debug.malloc.program statsd
adb shell setprop libc.debug.malloc.options backtrace
adb shell start
adb shell cmd stats meminfo
Also,
adb shell dumpsys meminfo [statsd_pid]
also gives you the overall summary of the memory usage.
Test: manual
Change-Id: I4eb4167466a748ea0c3d9fd39e45d9900bc00fc2
My previous understanding of the liblog api was wrong. Luckily it
is caught in time. Also added a memory profiling tool in another CL.
Test: statsd_test
adb shell dumpsys meminfo
adb shell cmd stats meminfo
Change-Id: I742af2a38e52e35edf0d4c77ccc35ede7019a73b
StatsD will send a broadcast when we're 90% of the way to our
allocated memory limit for the configuration. If the memory usage
goes over the limit, we just lose all the data for this config.
Also modifies the adb shell commands to facilitate debugging of the
broadcasts.
Test: Manually tested on marlin-eng with custom gmscore code.
Change-Id: I517a15bd4c959aa221802f84a51f13141a725102
+ Changed how we construct LogEvent, now it's based on the context from log_msg
without making a copy of the list.
+ All stats logs now have the same event tag, the atom id is the first elem in the log.
Test: statsd_test
Change-Id: I4419380f2ee1c2b2155d427b9f2adb78883b337f
+ Added counters to count the starts.
Test: added some unit test in statsd_test.
TODO: ADD MORE UNIT TESTS
Change-Id: I3575e921a4abab27c4ea50fffde19cc1d4564030
There are other statsd_config changes for Anomaly detection, but requires
code change. So will sync later.
Test: statsd_test
Change-Id: I927e99bd0763cb949fe339993b232f53a4eefe7a
Also make atom WakelockStateChanged use the "Type" enum instead of int32.
Test: Unittests are passing. Statsd is working.
Change-Id: I0909e2d97297f78996a81366d66aae62d5bf5ce1
1/ use string id/name for all metrics/configs/matchers.
2/ move alerts out of metric proto.
Test: unit test passed.
Change-Id: I08269f47be30f83f6dbadf873e7d62213449932b
This API will primarily be used by GmsCore to send updated configs.
Also, sending a config will implicitly notify the StatsD that this
client wants to know when it should request data for this config.
We send a broadcast so that all interested subscribers can know if
data needs to be pulled.
Test: Manually tested that sending broadcast works via new adb
command added in StatsService.
Change-Id: I23cdd1df706036e14b32c3d01af30c3d4af819fa
StatsPullerManager is refactored so that we can mock it.
It may need more refactor pass to make is safer for longer runs.
Test: unit test
Change-Id: Ief0c99710e4d06e1454678f8b749c9599467d114
Note: these pullers return monotonically increasing numbers.
The uids could include isolated uids that needs further translation in
statsd.
Test: manually tested on device and check print outs
Change-Id: I7097aec0417a3ac567b9b86149b757ac27cd58d8
2. Resolve segfault when serializing proto into vector of uint8_t
3. Add a local byte size variable for EventMetric data as we cannot call
size() of ProtoOutputStream before we finish writing.
4. Replace hardcoded conversion of second to nano second with NS_PER_SEC
Test: statsd, statsd_test
Change-Id: I47a2ce2b05e6191c18596489682118edcb41e945