diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 23:57:07 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 23:57:07 +0000 |
commit | ef114cb3f0cbe105dc999b391c79f4e7d8964d93 (patch) | |
tree | 984c420208ad30e9bf7f847b6dc235f1910d68e4 /net/disk_cache/backend_impl.cc | |
parent | 8fd8de981b580be7513e7e8be16d4f0249f56ff3 (diff) | |
download | chromium_src-ef114cb3f0cbe105dc999b391c79f4e7d8964d93.zip chromium_src-ef114cb3f0cbe105dc999b391c79f4e7d8964d93.tar.gz chromium_src-ef114cb3f0cbe105dc999b391c79f4e7d8964d93.tar.bz2 |
Re submitting the histograms change (735)
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@763 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/backend_impl.cc')
-rw-r--r-- | net/disk_cache/backend_impl.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index 0a09148..9ffb97e 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -30,6 +30,7 @@ #include "net/disk_cache/backend_impl.h" #include "base/file_util.h" +#include "base/histogram.h" #include "base/message_loop.h" #include "base/scoped_handle.h" #include "base/string_util.h" @@ -325,6 +326,7 @@ bool BackendImpl::OpenEntry(const std::string& key, Entry** entry) { if (disabled_) return false; + Time start = Time::Now(); uint32 hash = Hash(key); EntryImpl* cache_entry = MatchEntry(key, hash, false); @@ -336,6 +338,7 @@ bool BackendImpl::OpenEntry(const std::string& key, Entry** entry) { DCHECK(entry); *entry = cache_entry; + UMA_HISTOGRAM_TIMES(L"DiskCache.OpenTime", Time::Now() - start); stats_.OnEvent(Stats::OPEN_HIT); return true; } @@ -344,6 +347,7 @@ bool BackendImpl::CreateEntry(const std::string& key, Entry** entry) { if (disabled_ || key.empty()) return false; + Time start = Time::Now(); uint32 hash = Hash(key); scoped_refptr<EntryImpl> parent; @@ -406,6 +410,7 @@ bool BackendImpl::CreateEntry(const std::string& key, Entry** entry) { *entry = NULL; cache_entry.swap(reinterpret_cast<EntryImpl**>(entry)); + UMA_HISTOGRAM_TIMES(L"DiskCache.CreateTime", Time::Now() - start); stats_.OnEvent(Stats::CREATE_HIT); Trace("create entry hit "); return true; @@ -1034,6 +1039,7 @@ void BackendImpl::TrimCache(bool empty) { if (disabled_) return; + Time start = Time::Now(); Rankings::ScopedRankingsBlock node(&rankings_); Rankings::ScopedRankingsBlock next(&rankings_, rankings_.GetPrev(node.get())); DCHECK(next.get()); @@ -1053,6 +1059,9 @@ void BackendImpl::TrimCache(bool empty) { if (node->Data()->pointer) { entry = EntryImpl::Update(entry); } + static Histogram counter(L"DiskCache.TrimAge", 1, 10000, 50); + counter.SetFlags(kUmaTargetedHistogramFlag); + counter.Add((Time::Now() - entry->GetLastUsed()).InHours()); entry->Doom(); entry->Release(); if (!empty) @@ -1060,6 +1069,7 @@ void BackendImpl::TrimCache(bool empty) { } } + UMA_HISTOGRAM_TIMES(L"DiskCache.TotalTrimTime", Time::Now() - start); Trace("*** Trim Cache end ***"); return; } |