0

SimpleCache: more histograms watching how index is loaded.

The index is stale in about 50% of cases and often takes longer than 10s to
restore. We need to watch this closer: looking at sizes of the cache on load,
speculating on per-entry overhead for loading.

BUG=none

Review URL: https://chromiumcodereview.appspot.com/16286015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204619 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
pasko@chromium.org
2013-06-06 22:05:41 +00:00
parent 219b252eac
commit aeb2d4fe72
2 changed files with 18 additions and 3 deletions
net/disk_cache/simple
tools/metrics/histograms

@ -301,7 +301,9 @@ void SimpleIndexFile::LoadIndexEntriesInternal(
const base::TimeTicks start = base::TimeTicks::Now();
index_file_entries = LoadFromDisk(index_file_path);
UMA_HISTOGRAM_TIMES("SimpleCache.IndexLoadTime",
(base::TimeTicks::Now() - start));
base::TimeTicks::Now() - start);
UMA_HISTOGRAM_COUNTS("SimpleCache.IndexEntriesLoaded",
index_file_entries->size());
}
UMA_HISTOGRAM_BOOLEAN("SimpleCache.IndexStale", index_stale);
@ -310,8 +312,10 @@ void SimpleIndexFile::LoadIndexEntriesInternal(
if (!index_file_entries) {
const base::TimeTicks start = base::TimeTicks::Now();
index_file_entries = RestoreFromDisk(index_file_path);
UMA_HISTOGRAM_TIMES("SimpleCache.IndexRestoreTime",
(base::TimeTicks::Now() - start));
UMA_HISTOGRAM_MEDIUM_TIMES("SimpleCache.IndexRestoreTime",
base::TimeTicks::Now() - start);
UMA_HISTOGRAM_COUNTS("SimpleCache.IndexEntriesRestored",
index_file_entries->size());
// When we restore from disk we write the merged index file to disk right
// away, this might save us from having to restore again next time.

@ -10028,6 +10028,17 @@ other types of suffix sets.
<summary>The number of entries in a newly created index file.</summary>
</histogram>
<histogram name="SimpleCache.IndexEntriesLoaded">
<summary>Number of entries loaded from the index file on start.</summary>
</histogram>
<histogram name="SimpleCache.IndexEntriesRestored">
<summary>
Number of entries restored from disk when there was no index or the index
was corrupted.
</summary>
</histogram>
<histogram name="SimpleCache.IndexInitializationWaiters">
<summary>
At the time of index initialization, the number of enqueued jobs awaiting