summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/backend_impl.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 17:28:31 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 17:28:31 +0000
commit55185493afba3b7813d44a25c614975c0bc0f32b (patch)
treeb8891744621915ba5cd12d0dd8e305f3ec5e0c5f /net/disk_cache/backend_impl.cc
parentb235357d38b41a6d3dbf552fd9f4aee3261af0ba (diff)
downloadchromium_src-55185493afba3b7813d44a25c614975c0bc0f32b.zip
chromium_src-55185493afba3b7813d44a25c614975c0bc0f32b.tar.gz
chromium_src-55185493afba3b7813d44a25c614975c0bc0f32b.tar.bz2
Disk Cache: Split some time histograms in groups based
on the cache size. BUG=10727 TEST=none Review URL: http://codereview.chromium.org/146129 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19256 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/backend_impl.cc')
-rw-r--r--net/disk_cache/backend_impl.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index 5f7eb93..d17b5e3 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -361,7 +361,7 @@ bool BackendImpl::OpenEntry(const std::string& key, Entry** entry) {
DCHECK(entry);
*entry = cache_entry;
- CACHE_UMA(AGE_MS, "OpenTime", 0, start);
+ CACHE_UMA(AGE_MS, "OpenTime", GetSizeGroup(), start);
stats_.OnEvent(Stats::OPEN_HIT);
return true;
}
@@ -439,7 +439,7 @@ bool BackendImpl::CreateEntry(const std::string& key, Entry** entry) {
cache_entry.swap(reinterpret_cast<EntryImpl**>(entry));
- CACHE_UMA(AGE_MS, "CreateTime", 0, start);
+ CACHE_UMA(AGE_MS, "CreateTime", GetSizeGroup(), start);
stats_.OnEvent(Stats::CREATE_HIT);
Trace("create entry hit ");
return true;
@@ -750,6 +750,17 @@ std::string BackendImpl::HistogramName(const char* name, int experiment) {
return StringPrintf("DiskCache.%d.%s_%d", cache_type_, name, experiment);
}
+int BackendImpl::GetSizeGroup() {
+ if (disabled_)
+ return 0;
+
+ // We want to report times grouped by the current cache size (50 MB groups).
+ int group = data_->header.num_bytes / (50 * 1024 * 1024);
+ if (group > 6)
+ group = 6; // Limit the number of groups, just in case.
+ return group;
+}
+
// We want to remove biases from some histograms so we only send data once per
// week.
bool BackendImpl::ShouldReportAgain() {