diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-16 19:17:41 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-16 19:17:41 +0000 |
commit | 557f1c9bb1c8c7f5cebbb6914a244b4b111725a6 (patch) | |
tree | 56bd879ca4b68c3bacf4731c34a770ba5e13b4e1 /net | |
parent | e3ebbbd6c3bec654f47a4934801a321185931eb4 (diff) | |
download | chromium_src-557f1c9bb1c8c7f5cebbb6914a244b4b111725a6.zip chromium_src-557f1c9bb1c8c7f5cebbb6914a244b4b111725a6.tar.gz chromium_src-557f1c9bb1c8c7f5cebbb6914a244b4b111725a6.tar.bz2 |
Disk Cache: Send only one eviction age data point per browser execution.
The eviction age analysis can be simplified (and it will be closer to what
we really want to know) if we don't add the age of every entry, and instead
use only the first evicted entry per run.
Review URL: http://codereview.chromium.org/14448
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7073 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/disk_cache/backend_impl.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index ed8492c..c9a2315 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -1075,11 +1075,15 @@ void BackendImpl::TrimCache(bool empty) { } void BackendImpl::ReportTrimTimes(EntryImpl* entry) { - std::wstring name(StringPrintf(L"DiskCache.TrimAge_%d", - data_->header.experiment)); - static Histogram counter(name.c_str(), 1, 10000, 50); - counter.SetFlags(kUmaTargetedHistogramFlag); - counter.Add((Time::Now() - entry->GetLastUsed()).InHours()); + static bool first_time = true; + if (first_time) { + first_time = false; + std::wstring name(StringPrintf(L"DiskCache.TrimAge_%d", + data_->header.experiment)); + static Histogram counter(name.c_str(), 1, 10000, 50); + counter.SetFlags(kUmaTargetedHistogramFlag); + counter.Add((Time::Now() - entry->GetLastUsed()).InHours()); + } } void BackendImpl::AddStorageSize(int32 bytes) { |