platform_system_core/storaged
Jin Qian d691d6e941 storaged: record IO perf history from proto updates
Record the bandwidth when writing storaged.proto to monitor system
storage performance.

The history is maintained in 3 catergories.
1. samples of last 24 hours.
2. daily average of last 7 days.
3. weekly average of last 52 weeks.

Sampling frequency of the first catergory is set to once every hour.
Storaged also flushes proto at same frequency.

The proto file is padded to reach a minimal size of 128KB. Storaged
writes 16KB at a time. Bandwidth calculation ignores time spent in
the first write and writes smaller than 16KB.

bandwidth = total size of 16KB writes / time spent in 16KB writes

Restructured the code so that storaged.cpp handles proto load/flush.
It calls individual module to sync proto with internal data
structures.

Added a cmdline argument to dump perf history.

adb shell storaged -p
I/O perf history (KB/s) :  most_recent  <---------  least_recent
last 24 hours : 5315 3775 3659 2042 3890 5652 3649 3696 6023
last 7 days   : 4648 3532 3828 3567 3841 3359 4676
last 52 weeks : 3817 4275 3836 3766 4280 0 0 0 0 0 ...

Test: adb shell storaged -p
      atp:asit/perf/jank_systemui_test
      atp:asit/perf/appstartup_hermetic_cyclic_dropcache_test
      atp:asit/perf/appstartup_non_hermetic_cyclic_dropcache_test

Bug: 63629306
Change-Id: Ie7051e7a8df883d4a6818ea9a54a10f4dccb4843
2017-10-10 00:56:03 +00:00
..
include storaged: record IO perf history from proto updates 2017-10-10 00:56:03 +00:00
tests storaged: record IO perf history from proto updates 2017-10-10 00:56:03 +00:00
tools storaged: add parser for dumpsys storaged output 2017-08-09 15:25:19 -07:00
Android.bp storaged: clean up disk stats code 2017-10-02 15:45:14 -07:00
EventLogTags.logtags storaged: change uid_io reporting 2017-01-30 14:22:49 -08:00
main.cpp storaged: record IO perf history from proto updates 2017-10-10 00:56:03 +00:00
README.properties storaged: read emmc health data from sysfs 2017-04-03 16:48:14 +00:00
storaged.cpp storaged: record IO perf history from proto updates 2017-10-10 00:56:03 +00:00
storaged.proto storaged: record IO perf history from proto updates 2017-10-10 00:56:03 +00:00
storaged.rc storaged: store io_history as protobuf file on userdata 2017-08-15 17:00:19 -07:00
storaged_diskstats.cpp storaged: clean up disk stats code 2017-10-02 15:45:14 -07:00
storaged_info.cpp storaged: record IO perf history from proto updates 2017-10-10 00:56:03 +00:00
storaged_service.cpp storaged: record IO perf history from proto updates 2017-10-10 00:56:03 +00:00
storaged_uid_monitor.cpp storaged: record IO perf history from proto updates 2017-10-10 00:56:03 +00:00
storaged_utils.cpp storaged: record IO perf history from proto updates 2017-10-10 00:56:03 +00:00

ro.storaged.event.interval    # interval storaged scans for IO stats, in seconds
ro.storaged.event.perf_check  # check for time spent in event loop, in microseconds
ro.storaged.disk_stats_pub    # interval storaged publish disk stats, in seconds
ro.storaged.uid_io.interval   # interval storaged checks Per UID IO usage, in seconds
ro.storaged.uid_io.threshold  # Per UID IO usage limit, in bytes