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-03-20 21:49:00 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-20 21:49:00 +0000
commit97ac07d0ffcca8e53812577472d62d76ae862d7b (patch)
tree00dc361586c14cb572a6aa3194758fb8b0fec059 /net/disk_cache/eviction.cc
parent8e261756c62de3737c5dc9b9418857e2b58a7618 (diff)
downloadchromium_src-97ac07d0ffcca8e53812577472d62d76ae862d7b.zip
chromium_src-97ac07d0ffcca8e53812577472d62d76ae862d7b.tar.gz
chromium_src-97ac07d0ffcca8e53812577472d62d76ae862d7b.tar.bz2
Disk cache: More instrumentation for the cache.
Now we separate data between before and after the cache is full. Also, reduce the rate at which a particular client sends data to be only once a week. The effect is that the histogram data will only have one value per client, and the same client will not be "voting" on more than one version (release) at the same time. Review URL: http://codereview.chromium.org/50063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12218 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/eviction.cc')
-rw-r--r--net/disk_cache/eviction.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/net/disk_cache/eviction.cc b/net/disk_cache/eviction.cc
index 6f7df82..16d0957 100644
--- a/net/disk_cache/eviction.cc
+++ b/net/disk_cache/eviction.cc
@@ -140,11 +140,19 @@ void Eviction::ReportTrimTimes(EntryImpl* entry) {
static bool first_time = true;
if (first_time) {
first_time = false;
- std::string name(StringPrintf("DiskCache.TrimAge_%d",
- header_->experiment));
- static Histogram counter(name.c_str(), 1, 10000, 50);
- counter.SetFlags(kUmaTargetedHistogramFlag);
- counter.Add((Time::Now() - entry->GetLastUsed()).InHours());
+ if (backend_->ShouldReportAgain()) {
+ std::string name(StringPrintf("DiskCache.TrimAge_%d",
+ header_->experiment));
+ static Histogram counter(name.c_str(), 1, 10000, 50);
+ counter.SetFlags(kUmaTargetedHistogramFlag);
+ counter.Add((Time::Now() - entry->GetLastUsed()).InHours());
+ }
+
+ if (header_->create_time || !header_->lru.filled) {
+ // This is the first entry that we have to evict, generate some noise.
+ header_->lru.filled = 1;
+ backend_->FirstEviction();
+ }
}
}