Commit Graph

17 Commits

Author SHA1 Message Date
Yangster-mac
c04feba805 Move forward the alarm timestamp when config is added to statsd.
Test: statsd test
BUG: b/77344187

Change-Id: Ieacffaa29422829b8956f2b3fcb2c647c8c3eed9
2018-04-02 18:12:36 -07:00
Yao Chen
427d372552 Support sliced condition change in GaugeMetric
TODO: We need CTS to verify the behavior.

Bug: 73958484
Test: statsd_test
Change-Id: I56406983ddede12bc6a2e12188693a0c51ccae5c
2018-03-27 09:21:19 -07:00
Yangster-mac
932ececa16 Alarm: wakes up statsd and notifies the subscribers.
Test: manually tested it.
Change-Id: Id796a68976aeb1611183023ba4e9c6a8b8c44bb8
2018-02-27 13:30:48 -08:00
yro
6e304ec690 Reinstate configs from disk across boots by fixing bugs
- Update configName to configID in StorageManager reflecting ag/3410772
- Fix a bug of using strtok destructivelyand correctly parse file name
- Fix a unit test to call StartupForTest of config manager

Bug: 70667694
Test: statsd, statsd_test
Change-Id: If32c02982d1f0c509bdd4e6f445924257bbc074b
2018-01-17 13:44:34 -08:00
yro
469cd80840 Use the configs from disk after reboot and separate out ConfigManager
startup for unit test to avoid reading configs for tests

Bug: 70667694
Test: manual testing conducted, statsd, statsd_test
Change-Id: I49cb82d2b1d7c178b7a4c30c089d8d93e7902faa
2018-01-04 15:00:48 -08:00
Yangster-mac
94e197cceb 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
2018-01-03 15:34:00 -08:00
Yao Chen
d10f7b1c7b Add log source filtering in statsd to filter out spams.
+ Add log source whitelist in StatsdConfig
+ Some changes in UidMap API. Listener needs to be wp instead of sp.
+ Update dogfood app config to have log source
+ Increase the stats service thread pool size to 10 (9+1).

TODO: add unit tests(b/70805664). This unit test takes some time to write.

Test: statsd_test & manual

Change-Id: I129b1cc13db5114db7417580962bd7cc4438519d
2017-12-20 18:45:43 -08:00
TreeHugger Robot
e6abcbed99 Merge "Turn off verbose logging, remove the fake config." 2017-12-17 17:01:36 +00:00
Chenjie Yu
85ed838713 align metrics to 5min bundary
We use one alarm clock for all pulled atoms.
If metrics from different configs are not aligned,
the clock will be set to repeat at higher and higher
frequency, and consume a lot of battery.
Current implementation assumes a 5min minimum bucket
size. New metric start time is set to be aligned to
the start time of statsd in the next 5min.
So it will ignore events up to 5min.

align puller alarm to minute bundary

Test: unit test
Change-Id: I77ffa3c13de363c780b1000181b9a9b780dd0846
2017-12-16 17:08:46 -08:00
Yao Chen
3c0b95ceb5 Turn off verbose logging, remove the fake config.
Test: statsd_test & manual
Change-Id: I43068c8db006cbbeccacaa9d8426ab4d0394313a
2017-12-16 14:34:20 -08:00
Yao Chen
b356151e63 Add StatsdStats and guardrail.
+ StatsdStats is the global class that tracks the stats about statsd.

+ Added guardrail for classes that have a map which could potentially grow
  unboundedly with the number of logs.

TODO: add unit tests & CTS for StatsdStats, and guardrail
      add stats for pulled atoms.

Test: statsd_test

Change-Id: I0ea562de4dd3f6162f7923a9c193420b482c1d51
2017-11-27 10:52:54 -08:00
TreeHugger Robot
74b1513fe6 Merge "Set the metric name for alerts in fake config and add a test to make sure the fake config is valid.." 2017-11-23 00:26:48 +00:00
Yangster-mac
756cd48749 Set the metric name for alerts in fake config and add a test to make sure the fake config is valid..
Test: unit test passed.
Change-Id: I1879fc523cca9fc6c672332ab4ac383f21dc16fc
2017-11-22 13:43:25 -08:00
Yao Chen
93f46aa9f1 Fix ConfigManager unit test.
Test: statsd_test
Change-Id: I47c5458fef7a30a618e783a94c3f10659d0be742
2017-11-22 12:51:10 -08:00
Yao Chen
ff2632829f Fix the unit test failure.
Test: statsd_test
Change-Id: I7ab57d4eb8789523a2b435413fd35057602cc988
2017-11-18 12:03:42 -08:00
Yangster-mac
d1815dc7b8 Sync statsd to the public proto changes:
1/ use string id/name for all metrics/configs/matchers.
2/ move alerts out of metric proto.

Test: unit test passed.
Change-Id: I08269f47be30f83f6dbadf873e7d62213449932b
2017-11-13 22:09:08 -08:00
Joe Onorato
9fc9edf95a 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
2017-10-18 04:18:58 -07:00