From ad4984168f95ab7b519577fc2434cd9f270168e6 Mon Sep 17 00:00:00 2001 From: "rvargas@chromium.org" Date: Fri, 12 Oct 2012 01:17:51 +0000 Subject: Disk cache: Track evictions of ga.js. The purpose is to understand the cache behavior with very popular resources. BUG=147383 TEST=none Review URL: https://chromiumcodereview.appspot.com/11000062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161468 0039d316-1c4b-4281-b951-d872f2087c98 --- net/disk_cache/backend_impl.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'net/disk_cache/backend_impl.cc') diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index 2de5952..e7fd5d6 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -1538,6 +1538,7 @@ void BackendImpl::RestartCache(bool failure) { int64 errors = stats_.GetCounter(Stats::FATAL_ERROR); int64 full_dooms = stats_.GetCounter(Stats::DOOM_CACHE); int64 partial_dooms = stats_.GetCounter(Stats::DOOM_RECENT); + int64 ga_evictions = stats_.GetCounter(Stats::GAJS_EVICTED); int64 last_report = stats_.GetCounter(Stats::LAST_REPORT); PrepareForRestart(); @@ -1557,6 +1558,7 @@ void BackendImpl::RestartCache(bool failure) { stats_.SetCounter(Stats::FATAL_ERROR, errors); stats_.SetCounter(Stats::DOOM_CACHE, full_dooms); stats_.SetCounter(Stats::DOOM_RECENT, partial_dooms); + stats_.SetCounter(Stats::GAJS_EVICTED, ga_evictions); stats_.SetCounter(Stats::LAST_REPORT, last_report); } } @@ -2013,9 +2015,12 @@ void BackendImpl::ReportStats() { static_cast(stats_.GetCounter(Stats::DOOM_CACHE))); CACHE_UMA(COUNTS_10000, "TotalDoomRecentEntries", 0, static_cast(stats_.GetCounter(Stats::DOOM_RECENT))); + CACHE_UMA(COUNTS_10000, "TotalEvictionsGaJs", 0, + static_cast(stats_.GetCounter(Stats::GAJS_EVICTED))); stats_.SetCounter(Stats::FATAL_ERROR, 0); stats_.SetCounter(Stats::DOOM_CACHE, 0); stats_.SetCounter(Stats::DOOM_RECENT, 0); + stats_.SetCounter(Stats::GAJS_EVICTED, 0); int64 total_hours = stats_.GetCounter(Stats::TIMER) / 120; if (!data_->header.create_time || !data_->header.lru.filled) { -- cgit v1.1