diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-27 20:12:34 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-27 20:12:34 +0000 |
commit | 17a8396f14051151059e95ce14b8a3e27b7c5882 (patch) | |
tree | 01f45ab023a8115f552f81a21da3b5f6cbfd4aa0 /net/disk_cache/eviction.cc | |
parent | 63088d3724219e46dfa72818249553bbb6781345 (diff) | |
download | chromium_src-17a8396f14051151059e95ce14b8a3e27b7c5882.zip chromium_src-17a8396f14051151059e95ce14b8a3e27b7c5882.tar.gz chromium_src-17a8396f14051151059e95ce14b8a3e27b7c5882.tar.bz2 |
Disk Cache: Second pass (and final) to allow multiple instances
of BackendImpl.
This cl takes care of all the histograms on the disk cache. Most
of them have to be splitted in three so that we get separate data
from different cache types. There are a few places where the complexity
of splitting the histogram is not worth it so we just keep either all
data together (if it makes sense), or just ignore data for some types of
caches.
note: Having multiple versions of a histogram but only one "active" for a
given client is not the same as having multiple histograms working at the
same time for different objects.
Review URL: http://codereview.chromium.org/42682
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12692 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/eviction.cc')
-rw-r--r-- | net/disk_cache/eviction.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/net/disk_cache/eviction.cc b/net/disk_cache/eviction.cc index 76af8db..c000342 100644 --- a/net/disk_cache/eviction.cc +++ b/net/disk_cache/eviction.cc @@ -34,14 +34,11 @@ #include "base/time.h" #include "net/disk_cache/backend_impl.h" #include "net/disk_cache/entry_impl.h" +#include "net/disk_cache/histogram_macros.h" #include "net/disk_cache/trace.h" using base::Time; -// HISTOGRAM_HOURS will collect time related data with a granularity of hours -// and normal values of a few months. -#define UMA_HISTOGRAM_HOURS UMA_HISTOGRAM_COUNTS_10000 - namespace { const int kCleanUpMargin = 1024 * 1024; @@ -105,7 +102,7 @@ void Eviction::TrimCache(bool empty) { } } - UMA_HISTOGRAM_TIMES("DiskCache.TotalTrimTime", Time::Now() - start); + CACHE_UMA(AGE_MS, "TotalTrimTime", 0, start); Trace("*** Trim Cache end ***"); return; } @@ -145,10 +142,7 @@ void Eviction::ReportTrimTimes(EntryImpl* entry) { if (first_trim_) { first_trim_ = false; if (backend_->ShouldReportAgain()) { - std::string name(StringPrintf("DiskCache.TrimAge_%d", - header_->experiment)); - UMA_HISTOGRAM_HOURS(name.c_str(), - (Time::Now() - entry->GetLastUsed()).InHours()); + CACHE_UMA(AGE, "TrimAge", header_->experiment, entry->GetLastUsed()); } if (header_->create_time && !header_->lru.filled) { @@ -265,7 +259,7 @@ void Eviction::TrimCacheV2(bool empty) { factory_.NewRunnableMethod(&Eviction::TrimDeleted, empty)); } - UMA_HISTOGRAM_TIMES("DiskCache.TotalTrimTime", Time::Now() - start); + CACHE_UMA(AGE_MS, "TotalTrimTime", 0, start); Trace("*** Trim Cache end ***"); return; } @@ -375,7 +369,7 @@ void Eviction::TrimDeleted(bool empty) { MessageLoop::current()->PostTask(FROM_HERE, factory_.NewRunnableMethod(&Eviction::TrimDeleted, false)); - UMA_HISTOGRAM_TIMES("DiskCache.TotalTrimDeletedTime", Time::Now() - start); + CACHE_UMA(AGE_MS, "TotalTrimDeletedTime", 0, start); Trace("*** Trim Deleted end ***"); return; } |