From b8c541b9d4f8769f5a191340f479c957f9886b38 Mon Sep 17 00:00:00 2001 From: "rvargas@google.com" Date: Tue, 12 Aug 2008 18:48:56 +0000 Subject: Add a few histograms to the disk cache. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@735 0039d316-1c4b-4281-b951-d872f2087c98 --- net/disk_cache/rankings.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'net/disk_cache/rankings.cc') diff --git a/net/disk_cache/rankings.cc b/net/disk_cache/rankings.cc index 81b5767..42667cc 100644 --- a/net/disk_cache/rankings.cc +++ b/net/disk_cache/rankings.cc @@ -29,6 +29,7 @@ #include "net/disk_cache/rankings.h" +#include "base/histogram.h" #include "net/disk_cache/backend_impl.h" #include "net/disk_cache/entry_impl.h" #include "net/disk_cache/errors.h" @@ -203,6 +204,7 @@ void Rankings::Reset() { } bool Rankings::GetRanking(CacheRankingsBlock* rankings) { + Time start = Time::Now(); if (!rankings->address().is_initialized()) return false; @@ -233,6 +235,7 @@ bool Rankings::GetRanking(CacheRankingsBlock* rankings) { EntryImpl* cache_entry = reinterpret_cast(rankings->Data()->pointer); rankings->SetData(cache_entry->rankings()->Data()); + UMA_HISTOGRAM_TIMES(L"DiskCache.GetRankings", Time::Now() - start); return true; } @@ -380,8 +383,10 @@ void Rankings::Remove(CacheRankingsBlock* node) { // but the net effect is just an assert on debug when attempting to remove the // entry. Otherwise we'll need reentrant transactions, which is an overkill. void Rankings::UpdateRank(CacheRankingsBlock* node, bool modified) { + Time start = Time::Now(); Remove(node); Insert(node, modified); + UMA_HISTOGRAM_TIMES(L"DiskCache.UpdateRank", Time::Now() - start); } void Rankings::CompleteTransaction() { -- cgit v1.1