summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/eviction.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 19:19:07 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 19:19:07 +0000
commit070fd95297d8d8eb7076ea8ba0956dee74d0e4f9 (patch)
tree0cc92b8f856b852ed612ce391328aefd77b3cac3 /net/disk_cache/eviction.cc
parentd1cb9f53adcefd8f7ff6abc58ae7edd6f522a42d (diff)
downloadchromium_src-070fd95297d8d8eb7076ea8ba0956dee74d0e4f9.zip
chromium_src-070fd95297d8d8eb7076ea8ba0956dee74d0e4f9.tar.gz
chromium_src-070fd95297d8d8eb7076ea8ba0956dee74d0e4f9.tar.bz2
Disk cache: Set up a new experiment on the dev channel.
Enable the new eviction algorithm for 10% of the current users on the dev channel. Review URL: http://codereview.chromium.org/79064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/eviction.cc')
-rw-r--r--net/disk_cache/eviction.cc32
1 files changed, 30 insertions, 2 deletions
diff --git a/net/disk_cache/eviction.cc b/net/disk_cache/eviction.cc
index bae1e3a..b13361f 100644
--- a/net/disk_cache/eviction.cc
+++ b/net/disk_cache/eviction.cc
@@ -143,6 +143,7 @@ void Eviction::ReportTrimTimes(EntryImpl* entry) {
first_trim_ = false;
if (backend_->ShouldReportAgain()) {
CACHE_UMA(AGE, "TrimAge", 0, entry->GetLastUsed());
+ ReportListStats();
}
if (header_->create_time && !header_->lru.filled) {
@@ -219,8 +220,8 @@ void Eviction::TrimCacheV2(bool empty) {
// Make sure that frequently used items are kept for a minimum time; we know
// that this entry is not older than its current target, but it must be at
// least older than the target for list 0 (kTargetTime).
- if (Rankings::HIGH_USE == list &&
- !NodeIsOldEnough(next[Rankings::HIGH_USE].get(), 0))
+ if ((Rankings::HIGH_USE == list || Rankings::LOW_USE == list) &&
+ !NodeIsOldEnough(next[list].get(), 0))
list = 0;
}
@@ -413,4 +414,31 @@ int Eviction::SelectListByLenght() {
return 2;
}
+void Eviction::ReportListStats() {
+ if (!new_eviction_)
+ return;
+
+ Rankings::ScopedRankingsBlock last1(rankings_,
+ rankings_->GetPrev(NULL, Rankings::NO_USE));
+ Rankings::ScopedRankingsBlock last2(rankings_,
+ rankings_->GetPrev(NULL, Rankings::LOW_USE));
+ Rankings::ScopedRankingsBlock last3(rankings_,
+ rankings_->GetPrev(NULL, Rankings::HIGH_USE));
+ Rankings::ScopedRankingsBlock last4(rankings_,
+ rankings_->GetPrev(NULL, Rankings::DELETED));
+
+ if (last1.get())
+ CACHE_UMA(AGE, "NoUseAge", header_->experiment,
+ Time::FromInternalValue(last1.get()->Data()->last_used));
+ if (last2.get())
+ CACHE_UMA(AGE, "LowUseAge", header_->experiment,
+ Time::FromInternalValue(last2.get()->Data()->last_used));
+ if (last3.get())
+ CACHE_UMA(AGE, "HighUseAge", header_->experiment,
+ Time::FromInternalValue(last3.get()->Data()->last_used));
+ if (last4.get())
+ CACHE_UMA(AGE, "DeletedUseAge", header_->experiment,
+ Time::FromInternalValue(last4.get()->Data()->last_used));
+}
+
} // namespace disk_cache