diff options
author | pasko@chromium.org <pasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-20 17:34:49 +0000 |
---|---|---|
committer | pasko@chromium.org <pasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-20 17:34:49 +0000 |
commit | 7a11d3abff0057dbfa280fc1621f9007b59063d9 (patch) | |
tree | d487f8491c4ef0e9a1e423d0431bc0608eb7be18 /net/disk_cache/simple/simple_index.cc | |
parent | 40a286b1e402f92bf22061ba9442b34b96d07b44 (diff) | |
download | chromium_src-7a11d3abff0057dbfa280fc1621f9007b59063d9.zip chromium_src-7a11d3abff0057dbfa280fc1621f9007b59063d9.tar.gz chromium_src-7a11d3abff0057dbfa280fc1621f9007b59063d9.tar.bz2 |
Simple Cache Eviction: report sizes in KiB
The default counts were not useful, since they stop at 1MB, and all eviction
operated on sizes more than that. So compute this in KB, which whould provide
the range of 1MB - 500MB. Not ideal, but relatively OK.
This will probably break the consistency of the number across builds, but it
should be fine for our purposes. Just want to double-check if this careless mode
is supported by the processing pipeline.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/17112008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207478 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/simple/simple_index.cc')
-rw-r--r-- | net/disk_cache/simple/simple_index.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/disk_cache/simple/simple_index.cc b/net/disk_cache/simple/simple_index.cc index 8d65cbc..309614b 100644 --- a/net/disk_cache/simple/simple_index.cc +++ b/net/disk_cache/simple/simple_index.cc @@ -42,6 +42,8 @@ const int kDefaultWriteToDiskOnBackgroundDelayMSecs = 100; // is left. const uint32 kEvictionMarginDivisor = 20; +const uint32 kBytesInKb = 1024; + // Utility class used for timestamp comparisons in entry metadata while sorting. class CompareHashesForTimestamp { typedef disk_cache::SimpleIndex SimpleIndex; @@ -259,8 +261,10 @@ void SimpleIndex::StartEvictionIfNeeded() { // Take all live key hashes from the index and sort them by time. eviction_in_progress_ = true; eviction_start_time_ = base::TimeTicks::Now(); - UMA_HISTOGRAM_COUNTS("SimpleCache.Eviction.CacheSizeOnStart", cache_size_); - UMA_HISTOGRAM_COUNTS("SimpleCache.Eviction.MaxCacheSizeOnStart", max_size_); + UMA_HISTOGRAM_MEMORY_KB("SimpleCache.Eviction.CacheSizeOnStart2", + cache_size_ / kBytesInKb); + UMA_HISTOGRAM_MEMORY_KB("SimpleCache.Eviction.MaxCacheSizeOnStart2", + max_size_ / kBytesInKb); scoped_ptr<std::vector<uint64> > entry_hashes(new std::vector<uint64>()); for (EntrySet::const_iterator it = entries_set_.begin(), end = entries_set_.end(); it != end; ++it) { @@ -288,8 +292,8 @@ void SimpleIndex::StartEvictionIfNeeded() { UMA_HISTOGRAM_COUNTS("SimpleCache.Eviction.EntryCount", entry_hashes->size()); UMA_HISTOGRAM_TIMES("SimpleCache.Eviction.TimeToSelectEntries", base::TimeTicks::Now() - eviction_start_time_); - UMA_HISTOGRAM_COUNTS("SimpleCache.Eviction.SizeOfEvicted", - evicted_so_far_size); + UMA_HISTOGRAM_MEMORY_KB("SimpleCache.Eviction.SizeOfEvicted2", + evicted_so_far_size / kBytesInKb); index_file_->DoomEntrySet( entry_hashes.Pass(), @@ -316,7 +320,8 @@ void SimpleIndex::EvictionDone(int result) { UMA_HISTOGRAM_BOOLEAN("SimpleCache.Eviction.Result", result == net::OK); UMA_HISTOGRAM_TIMES("SimpleCache.Eviction.TimeToDone", base::TimeTicks::Now() - eviction_start_time_); - UMA_HISTOGRAM_COUNTS("SimpleCache.Eviction.SizeWhenDone", cache_size_); + UMA_HISTOGRAM_MEMORY_KB("SimpleCache.Eviction.SizeWhenDone2", + cache_size_ / kBytesInKb); } // static |