summaryrefslogtreecommitdiffstats
path: root/net/disk_cache
diff options
context:
space:
mode:
authorgavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-09 21:34:33 +0000
committergavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-09 21:34:33 +0000
commit6e14396edb32ebec86b5d1da55528f182f6599fa (patch)
treeb07efc3cd9eaacd6b57b684e17c278078647e70f /net/disk_cache
parentf7e48f1526964d61b40e0cdad33e0e13b04fc12b (diff)
downloadchromium_src-6e14396edb32ebec86b5d1da55528f182f6599fa.zip
chromium_src-6e14396edb32ebec86b5d1da55528f182f6599fa.tar.gz
chromium_src-6e14396edb32ebec86b5d1da55528f182f6599fa.tar.bz2
Add HttpCache histograms focussed on blocking and transaction type.
Most of our existing disk cache histograms focus on the speed of operations on the cache itself. This CL adds a bunch that break down http transactions by type, and track both time spent reading (either from disk cache or network), and time spent waiting for the disk cache to allow us to send the network request. Note that these patches are based on http://codereview.chromium.org/10797042/ , which must land first. R=rvargas@chromium.org, tburkhard@chromium.org BUG=None Review URL: https://chromiumcodereview.appspot.com/10808047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache')
-rw-r--r--net/disk_cache/backend_impl.cc4
-rw-r--r--net/disk_cache/backend_impl.h1
-rw-r--r--net/disk_cache/disk_cache.h3
-rw-r--r--net/disk_cache/mem_backend_impl.cc4
-rw-r--r--net/disk_cache/mem_backend_impl.h1
5 files changed, 13 insertions, 0 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index 185de7b..1fd92a1 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -1323,6 +1323,10 @@ void BackendImpl::FlushIndex() {
// ------------------------------------------------------------------------
+net::CacheType BackendImpl::GetCacheType() const {
+ return cache_type_;
+}
+
int32 BackendImpl::GetEntryCount() const {
if (!index_ || disabled_)
return 0;
diff --git a/net/disk_cache/backend_impl.h b/net/disk_cache/backend_impl.h
index d28dbba..ad6f8ff 100644
--- a/net/disk_cache/backend_impl.h
+++ b/net/disk_cache/backend_impl.h
@@ -260,6 +260,7 @@ class NET_EXPORT_PRIVATE BackendImpl : public Backend {
void FlushIndex();
// Backend implementation.
+ virtual net::CacheType GetCacheType() const OVERRIDE;
virtual int32 GetEntryCount() const OVERRIDE;
virtual int OpenEntry(const std::string& key, Entry** entry,
const CompletionCallback& callback) OVERRIDE;
diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h
index 3e29703..29688b1 100644
--- a/net/disk_cache/disk_cache.h
+++ b/net/disk_cache/disk_cache.h
@@ -67,6 +67,9 @@ class NET_EXPORT Backend {
// callback from within this method.
virtual ~Backend() {}
+ // Returns the type of this cache.
+ virtual net::CacheType GetCacheType() const = 0;
+
// Returns the number of entries in the cache.
virtual int32 GetEntryCount() const = 0;
diff --git a/net/disk_cache/mem_backend_impl.cc b/net/disk_cache/mem_backend_impl.cc
index 1580da9..0a23ebb 100644
--- a/net/disk_cache/mem_backend_impl.cc
+++ b/net/disk_cache/mem_backend_impl.cc
@@ -124,6 +124,10 @@ void MemBackendImpl::RemoveFromRankingList(MemEntryImpl* entry) {
rankings_.Remove(entry);
}
+net::CacheType MemBackendImpl::GetCacheType() const {
+ return net::MEMORY_CACHE;
+}
+
int32 MemBackendImpl::GetEntryCount() const {
return static_cast<int32>(entries_.size());
}
diff --git a/net/disk_cache/mem_backend_impl.h b/net/disk_cache/mem_backend_impl.h
index 1c6cdb0..0ef7bbc2 100644
--- a/net/disk_cache/mem_backend_impl.h
+++ b/net/disk_cache/mem_backend_impl.h
@@ -62,6 +62,7 @@ class NET_EXPORT_PRIVATE MemBackendImpl : public Backend {
void RemoveFromRankingList(MemEntryImpl* entry);
// Backend interface.
+ virtual net::CacheType GetCacheType() const OVERRIDE;
virtual int32 GetEntryCount() const OVERRIDE;
virtual int OpenEntry(const std::string& key, Entry** entry,
const CompletionCallback& callback) OVERRIDE;