diff options
author | Jeff Sharkey <jsharkey@android.com> | 2011-09-18 13:30:23 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2011-09-18 16:27:21 -0700 |
commit | 34c73acf88c8190b8cd51d8b8f2b9c22aa7f7941 (patch) | |
tree | 4ff5448905114823c6576a2c625ca312e003b543 /services/tests | |
parent | 00cd1d4e003d5b18dba978ca611a0eb083f8ae2b (diff) | |
download | frameworks_base-34c73acf88c8190b8cd51d8b8f2b9c22aa7f7941.zip frameworks_base-34c73acf88c8190b8cd51d8b8f2b9c22aa7f7941.tar.gz frameworks_base-34c73acf88c8190b8cd51d8b8f2b9c22aa7f7941.tar.bz2 |
Sample atomic network stats buckets, full poll.
When sampling network stats, always use atomic buckets instead of
interpolating. Always poll iface and UID together so we distribute
into buckets equally. Move stale bucket trimming to just before
writing stats.
Bug: 5321340
Change-Id: I78a2226778a79c875f3668336e39ea24a7b4d5c4
Diffstat (limited to 'services/tests')
-rw-r--r-- | services/tests/servicestests/src/com/android/server/NetworkStatsServiceTest.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/tests/servicestests/src/com/android/server/NetworkStatsServiceTest.java b/services/tests/servicestests/src/com/android/server/NetworkStatsServiceTest.java index 2b1eea1..99ae027 100644 --- a/services/tests/servicestests/src/com/android/server/NetworkStatsServiceTest.java +++ b/services/tests/servicestests/src/com/android/server/NetworkStatsServiceTest.java @@ -272,7 +272,11 @@ public class NetworkStatsServiceTest extends AndroidTestCase { // graceful shutdown system, which should trigger persist of stats, and // clear any values in memory. + expectCurrentTime(); + expectDefaultSettings(); + replay(); mServiceContext.sendBroadcast(new Intent(Intent.ACTION_SHUTDOWN)); + verifyAndReset(); // talk with zombie service to assert stats have gone; and assert that // we persisted them to file. @@ -487,6 +491,7 @@ public class NetworkStatsServiceTest extends AndroidTestCase { // now pretend two UIDs are uninstalled, which should migrate stats to // special "removed" bucket. + expectCurrentTime(); expectDefaultSettings(); replay(); final Intent intent = new Intent(ACTION_UID_REMOVED); @@ -758,7 +763,6 @@ public class NetworkStatsServiceTest extends AndroidTestCase { expect(mSettings.getUidMaxHistory()).andReturn(maxHistory).anyTimes(); expect(mSettings.getTagMaxHistory()).andReturn(maxHistory).anyTimes(); expect(mSettings.getTimeCacheMaxAge()).andReturn(DAY_IN_MILLIS).anyTimes(); - expect(mSettings.getForceCompletePoll()).andReturn(false).anyTimes(); } private void expectCurrentTime() throws Exception { |