diff options
author | gavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-24 20:10:20 +0000 |
---|---|---|
committer | gavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-24 20:10:20 +0000 |
commit | 468103f7fa4854a3fdcb72fd507ff54d0a42177e (patch) | |
tree | 0ba8e228888730edf03c414e3c2b1ef9d19ddc33 /net/disk_cache | |
parent | 873639e27af36392b3e84ac74d2885de27507756 (diff) | |
download | chromium_src-468103f7fa4854a3fdcb72fd507ff54d0a42177e.zip chromium_src-468103f7fa4854a3fdcb72fd507ff54d0a42177e.tar.gz chromium_src-468103f7fa4854a3fdcb72fd507ff54d0a42177e.tar.bz2 |
Add new histograms tracking cluster loss in the Simple Cache.
Simple disk cache entry files waste disk space at the end of their
last 4096 byte cluster. Let's track that both absolutely and as a
percentage of the entry itself.
R=pasko, clamy
Review URL: https://chromiumcodereview.appspot.com/19374007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213497 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache')
-rw-r--r-- | net/disk_cache/simple/simple_synchronous_entry.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc index 2b9c687..31ea4db 100644 --- a/net/disk_cache/simple/simple_synchronous_entry.cc +++ b/net/disk_cache/simple/simple_synchronous_entry.cc @@ -349,6 +349,12 @@ void SimpleSynchronousEntry::Close( Doom(); break; } + const int64 file_size = file_offset + sizeof(eof_record); + UMA_HISTOGRAM_CUSTOM_COUNTS("SimpleCache.LastClusterSize", + file_size % 4096, 0, 4097, 50); + const int64 cluster_loss = file_size % 4096 ? 4096 - file_size % 4096 : 0; + UMA_HISTOGRAM_PERCENTAGE("SimpleCache.LastClusterLossPercent", + cluster_loss * 100 / (cluster_loss + file_size)); } for (int i = 0; i < kSimpleEntryFileCount; ++i) { |