aboutsummaryrefslogtreecommitdiff
path: root/car-lib/src/android/car/storagemonitoring
AgeCommit message (Collapse)Author
2018-02-05Implement logic in CarStorageMonitoringManager to detect the cost (in terms ↵Enrico Granata
of disk I/O) of the previous shutdown ext4 and f2fs offer lifetime_write_kbytes files via sysfs that let userspace discover the amount of data written to each individual partition throughout its lifetime. Using this information, we execute this algorithm: - when CarService goes down, store lifetime_write_kbytes info for all mounted partitions; - at the next boot, calculate lifetime_write_kbytes for all mounted partitions again; - for every partition that existed at both shutdown and reboot, calculate the difference of the written amount; - add up those deltas: this is the total amount of writes since CarService went down; - take the aggregate UID I/O activity, and add up all bytes written to disk inferred from there: this is the cost of getting where we are; - subtract this aggregate from the previously computed total delta: this is a fair approximation of the cost of shutdown Test: tests in carservice_test and carservice_unit_test Bug: 32512551 Change-Id: Ia791eaa1fdb4bf026c1760e2bd333c30a413721f Fixes: 72236603
2017-12-19Merge "Implement cleanup of listeners at termination of Storage Monitoring ↵Enrico Granata
Service/Manager"
2017-12-18Implement cleanup of listeners at termination of Storage Monitoring ↵Enrico Granata
Service/Manager Fixes: 65846699 Bug: 32512551 Test: build Change-Id: If3c9cf6ef7e948a13cb0b0856b459554fdc46865
2017-12-18Rename storage monitoring data types for additional clarityEnrico Granata
Bug: 65846699 Bug: 32512551 Test: build and flash bit CarServiceUnitTest:com.android.car.storagemonitoring.CarStorageMonitoringTest Change-Id: I8d6c7b79dbfaada3dee1ec044b96c2a203e02c8b
2017-11-29Add JSON serialization support to UidIoStatsDeltaEnrico Granata
Test: bit CarServiceUnitTest:com.android.car.storagemonitoring.CarStorageMonitoringTest Bug: 65846699 Change-Id: Ib03c06bb76acbaace975e33a269027401179026c
2017-11-22Deliver an Intent on excessive I/O activityEnrico Granata
CarStorageMonitoringService will attempt to detect write rates and fsync call metrics that exceed an OEM-configurable threshold for appropriate behavior, and - should actual system activity go above those thresholds - it will deliver an intent to an OEM-specified receiver. Test: writing one Bug: 32512551 Bug: 65846699 Change-Id: I1bb5812d3d671067c62d8870c0ae98824d7590f0
2017-11-16Add listener registration for I/O activity deltas to CarStorageMonitoringManagerEnrico Granata
Test: bit CarServiceTest:com.android.car.CarStorageMonitoringTest Bug: 32512551 Bug: 65846699 Change-Id: I74f5d1ad3fe03329a34aef0bc32feb2149077c60
2017-11-09Implement CarStorageMonitoringManager::getIoStatsDeltasEnrico Granata
This API gives access to the periodic snapshot deltas of I/O activity calculated by CarStorageMonitoringService Bug: 32512551 Bug: 65846699 Test: bit CarServiceTest:com.android.car.CarStorageMonitoringTest bit CarServiceUnitTest:com.android.car.storagemonitoring.CarStorageMonitoringTest Change-Id: I833d4b4d0e63d6356b34584dbde3ba563e4aa899
2017-11-03Implement CarStorageMonitoringManager::getAggregateIoStatsEnrico Granata
This API allows callers to gather the current running total of I/O metrics happening on the system. Bug: 65846699 Bug: 32512551 Test: bit CarServiceTest:com.android.car.CarStorageMonitoringTest Change-Id: Ibc0f58ff4fbb1a1fe9ea9c2fff52db7a1b74b99a
2017-11-02Implement an object whose job it is to keep track of changes in uid_io stats ↵Enrico Granata
over time. This object will periodically ingest new uid_io records, and generate running totals over time, as well as generate a delta between the previous state of the system and the new records. Bug: 65846699 Bug: 32512551 Test: TARGET_USES_CAR_FUTURE_FEATURES=true bit CarServiceUnitTest:* Change-Id: Ia0169714b1882ec8931941a9334141b6ab2cb97c
2017-11-01Implement CarStorageMonitoringManager.getBootIoStats()Enrico Granata
This API returns information about I/O activity that the system performed from kernel initalization until the BOOT_COMPLETE notification was broadcast. Bug: 65846699 Bug: 32512551 Test: runtest -x p/s/C/tests/carservice[_unit]_test/src/com/android/car/CarStorageMonitoringTest.java Change-Id: I2eaed1491dc6a5dda8e34edd41047c64dcc2f537
2017-10-09Teach CarService how to parse /proc/uid_io/statsEnrico Granata
Bug: 32512551 Bug: 65846699 Test: runtest -x packages/services/Car/tests/carservice_unit_test/src/com/android/car/storagemonitoring/CarStorageMonitoringTest.java Change-Id: I70a7e453d8618308676aa44c5be24f4ca1859f44
2017-09-27Implement wear history trackingEnrico Granata
Bug: 32512551 Test: runtest -x packages/services/Car/tests/carservice_unit_test/src/com/android/car/storagemonitoring/CarStorageMonitoringTest.java runtest -x packages/services/Car/tests/carservice_test/src/com/android/car/CarStorageMonitoringTest.java Change-Id: Id024f9378e0a762cbdfeead9267deeebfa86fd40
2017-09-21Tweaks to CarStorageMonitoring:Enrico Granata
- add an API to retrieve the current wear estimates - protect API by system permission Test: KitchenSink and runtest -x packages/services/Car/tests/carservice_test/src/com/android/car/CarStorageMonitoringTest.java Bug: 32512551 Change-Id: I2a937dbc525d86c10f6c546b63eb992513807e54
2017-09-20Data model classes to track flash wear changesEnrico Granata
Bug: 32512551 Test: runtest -x packages/services/Car/tests/carservice_unit_test/src/com/android/car/storagemonitoring/CarStorageMonitoringTest.java Change-Id: Ic614851f1490331d1e5f37de06214b5d7082cc64
2017-09-20Sketch out CarStorageMonitoringService/CarStorageMonitoringManagerEnrico Granata
Bug: 32512551 Test: manual in KitchenSink Change-Id: I5b36b734223195a32d2e0632f0c35b0a470fa3c3