History log of /frameworks/base/cmds/statsd/src/storage/StorageManager.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
48944901f7e6334724efadda6c6b27d9e88fc9e2 03-May-2018 David Chen <dwchen@google.com> Fixes statsd returning too much data at once.

We observe a single ConfigMetricsReportList can be greater than the
safe size for the binder transaction buffer since we only check the
size of the current metrics in progress, but we also return the
previous reports stored on disk.

This change will attempt to send another ConfigMetricsReportList
as soon as possible if there's already a report on disk.

Also fixes a bug when trying to trigger data fetch before the client
has registered the corresponding dataFetchOperation.

Bug: 79201869
Test: Tested manually on marlin-eng
Change-Id: I2d3677162804a27e7a7a95d482d80c46bd994a67
/frameworks/base/cmds/statsd/src/storage/StorageManager.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/src/storage/StorageManager.cpp
fef48cb64c505664b078818455baebbe3cc025cb 21-Mar-2018 Yao Chen <yaochen@google.com> Fix StorageManager stack use after scope.

Bug: 75968524
Test: CTS
Change-Id: I2fd81a21452b26d8c9239d7aeddd4907b9618179
/frameworks/base/cmds/statsd/src/storage/StorageManager.cpp
4beccbe3de7537365856bbd2a34be8d6f226b8b8 16-Mar-2018 yro <yro@google.com> Fix recovery of stats data from previous input while using
ProtoOutputStream

- Specify the length of message to avoid libprotoutil from thinking that
we are trying to write bool
- We only attach the previous dump file to the upload file where config
key matches
- Store ConfigMetricsReport (instead of ConfigMetricsReportList) onto
disk
- Stop use stack after scope in StorageManager
- Migrate UidMap to use ProtoOutputStream and renaming variables to
prevent confusion

Bug: 74021554
Bug: 75968524
Test: manual test, statsd_test, CTS tests
Change-Id: Iedf52633d7f5b985f5a934a3fb5a0c3c3b2e7fd1
/frameworks/base/cmds/statsd/src/storage/StorageManager.cpp
665208d74345d779bed8724862e8d0d1c46a7a76 14-Mar-2018 yro <yro@google.com> Add stats from storage manager to dumpsys result

Bug: 74601313
Test: manual test, statsd_test
Change-Id: Ifdde6bb10d29f3983b0c27a66a6e30f1f40308ee
/frameworks/base/cmds/statsd/src/storage/StorageManager.cpp
4490765d1552f1a2ae114f9c301386823b930828 13-Mar-2018 yro <yro@google.com> Add a check for duplicate configuration on statsd

Bug: 74349901
Test: statsd_test, manual testing of functionality

Change-Id: Ia4e3e51bfe61f5f773cecadda23e53d24b768dc8
/frameworks/base/cmds/statsd/src/storage/StorageManager.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/src/storage/StorageManager.cpp
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/src/storage/StorageManager.cpp
484524a246ffe453f8cd89b698a279c23b0bde1f 02-Feb-2018 Tej Singh <singhtejinder@google.com> Turn off debug logging in statsd

Sets DEBUG to false everywhere and replaces all ALOGD with VLOG so they
do not print with DEBUG false. Leaves all ALOGI, ALOGW and ALOGE as is.

Test: ran all CTS tests and checked "adb logcat -s statsd" to make sure
it wasn't spammy

Change-Id: Iaa8eb3a0a63723ffe40f94f2815f94df877fd432
/frameworks/base/cmds/statsd/src/storage/StorageManager.cpp
50d23f1ed57003a389c010e3445bbc33b7c74a83 25-Jan-2018 yro <yro@google.com> Fix a bug of reading files with "_" separator

Test: manual testing
Change-Id: Ibb19336122684712b3eb73088553acd9438b7611
/frameworks/base/cmds/statsd/src/storage/StorageManager.cpp
d0c260ff418f0d1c9d1536eb1420373391116f88 25-Jan-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Adding guardrails on writing to disk from statsd"
98a28501fe8ab53a490ec353c8a1f74f2e329cc5 19-Jan-2018 yro <yro@google.com> Adding guardrails on writing to disk from statsd

- Limit total number of files to 1000
- Limit total size of files to 5MB
- Remove idle files to be deleted after 30 days

Bug: 69854160
Test: manual testing, statsd, statsd_test
Change-Id: I33148a3b7ca11d413ec2495d5c0659f1ba4485c3
/frameworks/base/cmds/statsd/src/storage/StorageManager.cpp
e5f82927ae60fdff909e030434354a6ba164f333 23-Jan-2018 yro <yro@google.com> Fix adb shell cmd config remove command when no (uid, id) pair is
specified.

- Previous logic was omitting commands when only 'adb shell cmd config
remove' was provided without any uid, id argument. This change fixes it.
- Recent disk guardrail change flips the convention of file name in
statsd directories to begin with timestamps. So delete with prefix was
changed to delete with suffix.

Bug: 72265185
Test: manual testing, statsd_test
Change-Id: Ia727fbc7acf0d9268b9f4952fa59975f4a9134cb
/frameworks/base/cmds/statsd/src/storage/StorageManager.cpp
6e304ec6901484157b9cae1cafc5713a825720bc 17-Jan-2018 yro <yro@google.com> 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
/frameworks/base/cmds/statsd/src/storage/StorageManager.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/storage/StorageManager.cpp
f09569f848ca0b81a21a74e9f4dd8bd9a886151a 14-Dec-2017 Yao Chen <yaochen@google.com> Further reduce statsd memory usage.

+ Remove the protobuf *Metric object from MetricProducers
-- This saves ~150 bytes per metric.
+ Remove the StatsdConfig from ConfigManager
-- This saves us xKB per config.
+ Also remove alerts from fake config to avoid crash (Bug: 70627390)
+ Other misc fixes too.

Test: statsd_test & manual
Change-Id: Ied4eb3fa31c50599817b3a5e1caf5077c487fad2
/frameworks/base/cmds/statsd/src/storage/StorageManager.cpp
03faf093301847f0ac293ce8d6fcb0bce657a841 12-Dec-2017 yro <yro@google.com> Migrate disk directory from /data/system/ to /data/misc/

Test: statsd, statsd_test
Change-Id: I6d2fe97afd79fb9b36d180d5e6e6a7a166a228b7
/frameworks/base/cmds/statsd/src/storage/StorageManager.cpp
c7bdc6291df427f2de9ba191246065f5ff87e11f 27-Nov-2017 Stefan Lafon <stlafon@google.com> Fix a bug in StorageManager.

Test: Ran statsd and statsd_test.

Change-Id: I2390c6d2c493981177b08d3861d7bee621253af3
/frameworks/base/cmds/statsd/src/storage/StorageManager.cpp
7250622b47397bd05983aa5655f18fb5cc757cb4 26-Nov-2017 Yao Chen <yaochen@google.com> Fix statsd crash caused by non-existing data folder.

Test: manual
Change-Id: Ie470279929ff6ce40c4828a3cdda6d78542a3caa
/frameworks/base/cmds/statsd/src/storage/StorageManager.cpp
947fbce521d9e8377df03e3c1c31884ed5577f32 16-Nov-2017 yro <yro@google.com> Captures metrics on disk when devices reboot and shutdown. Specifically,

1. Create intent receiver in StatsCompanionService to listen to shutdown
events.
2. Create StatsWriter class to handle disk writes and deleting files.
3. Update StatsLogProcessor, ConfigManager, and StatsService to handle
files on disk using StatsWriter.
4. Add a wrapper for ConfigMetricsReport.

Still TODO is to be able to add a guardrail to prevent accumulating
excessive amount files on disk, which will be followed up by another
change.

Test: statsd, statsd_test
Change-Id: Ia0b3af315af545daa8b0078b3700c600aa7c285f
/frameworks/base/cmds/statsd/src/storage/StorageManager.cpp