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-24 21:19:55 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-24 21:19:55 +0000
commit26d3857c6d85fc760ecf61276b5ffd6c61199a14 (patch)
tree51915c13c3e9c4c4ad748198f2f418658c039fc5 /net/disk_cache/eviction.cc
parent4639f17fd36f6eb1dea14c81ff01d94bdca0e39f (diff)
downloadchromium_src-26d3857c6d85fc760ecf61276b5ffd6c61199a14.zip
chromium_src-26d3857c6d85fc760ecf61276b5ffd6c61199a14.tar.gz
chromium_src-26d3857c6d85fc760ecf61276b5ffd6c61199a14.tar.bz2
Add a new histogram macro to replace a few explicit calls.
There is no real change in functionality. Review URL: http://codereview.chromium.org/42514 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12400 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/eviction.cc')
-rw-r--r--net/disk_cache/eviction.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/disk_cache/eviction.cc b/net/disk_cache/eviction.cc
index 16d0957..0075f5d 100644
--- a/net/disk_cache/eviction.cc
+++ b/net/disk_cache/eviction.cc
@@ -38,6 +38,10 @@
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;
@@ -143,9 +147,8 @@ void Eviction::ReportTrimTimes(EntryImpl* entry) {
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());
+ UMA_HISTOGRAM_HOURS(name.c_str(),
+ (Time::Now() - entry->GetLastUsed()).InHours());
}
if (header_->create_time || !header_->lru.filled) {