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>2008-09-24 23:51:25 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-24 23:51:25 +0000
commite2951cf3bd7e591a64ad5199a61531dac0ec58d2 (patch)
tree3039f816f6fa46008865c1ce4b1dd15de7b48d5a /net/disk_cache/backend_impl.cc
parent0e8db94aef1b57355c3d154cb4682ce2f94c51eb (diff)
downloadchromium_src-e2951cf3bd7e591a64ad5199a61531dac0ec58d2.zip
chromium_src-e2951cf3bd7e591a64ad5199a61531dac0ec58d2.tar.gz
chromium_src-e2951cf3bd7e591a64ad5199a61531dac0ec58d2.tar.bz2
Use histograms to send interesting parts of the disk cache statistics.
Most of this CL deals with a derived implementation of histograms that just queries the size stats already generated by the disk cache. The exact number of buckets, and their distribution, is controlled directly by the new class and the disk cache stats code. Review URL: http://codereview.chromium.org/3069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/backend_impl.cc')
-rw-r--r--net/disk_cache/backend_impl.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index 05d017a..c0fa867 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -676,6 +676,15 @@ void BackendImpl::OnStatsTimer() {
current /= time;
stats_.SetCounter(Stats::OPEN_ENTRIES, current);
stats_.SetCounter(Stats::MAX_ENTRIES, max_refs_);
+
+ static bool first_time = true;
+ if (first_time) {
+ first_time = false;
+ UMA_HISTOGRAM_COUNTS(L"DiskCache.Entries", data_->header.num_entries);
+ UMA_HISTOGRAM_COUNTS(L"DiskCache.Size",
+ data_->header.num_bytes / (1024 * 1024));
+ UMA_HISTOGRAM_COUNTS(L"DiskCache.MaxSize", max_size_ / (1024 * 1024));
+ }
}
void BackendImpl::IncrementIoCount() {