Skip to content
Commit 9e1206ce authored by Lee Shombert's avatar Lee Shombert
Browse files

PackageManagerService snapshot: statistics

Bug: 177425470

Collect periodic snapshot statistics.  The statistics are:
 1. Number of snapshots built
 2. Number of times a snapshot was reused
 3. Number of "big" snapshot build times
 4. Number of "quick" snapshot rebuilds
 4. Maximum time spent building a single snapshot
 5. Cumulative time spent building snapshots
All statistics are reset after being logged.

Collect event snapshot statistics.  The statistics are:
 1. The time taken for a big snapshot build
At most 5 events are logged in any periodic poll interval.

The periodic log interval is 10 minutes.  This will be lengthened
after we have some dogfood exprience.

A long snapshot build time is currently defined as anything over 5ms.

A quick snapshot rebuild is one that happens within 100ms of the
previous snapshot.

This change is designed to monitor the health of the snapshot feature.
A future improvement will allow statistics to be dumped on demand and
to report statistics via WestWorld.

Also:
 1. A places that still used the word "cache" are changed to use the
    word "snapshot".
 2. The unused DEBUG_CACHE flag is removed

Test: atest
 * FrameworksServicesTests:UserSystemPackageInstallerTest
 * FrameworksServicesTests:PackageManagerSettingsTests
 * FrameworksServicesTests:PackageManagerServiceTest
 * FrameworksServicesTests:AppsFilterTest
 * FrameworksServicesTests:PackageInstallerSessionTest
 * FrameworksServicesTests:ScanTests

Change-Id: Id964f7d9fc16cf49e064044643b3c65862183a7d
parent 3f08df9f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment