Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: net/disk_cache/simple/simple_index.cc

Issue 2355493003: [SimpleCache] Track some SimpleCache size stats on initialization (Closed)
Patch Set: Address comments from PS2 Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_index.cc
diff --git a/net/disk_cache/simple/simple_index.cc b/net/disk_cache/simple/simple_index.cc
index 6cf75ba4ebe522519f4967cf0fa0f87549156b5a..e68e7468f2071c0f4d27489d57c447c2d8ed0cdf 100644
--- a/net/disk_cache/simple/simple_index.cc
+++ b/net/disk_cache/simple/simple_index.cc
@@ -441,6 +441,20 @@ void SimpleIndex::MergeInitializingSet(
SIMPLE_CACHE_UMA(CUSTOM_COUNTS,
"IndexInitializationWaiters", cache_type_,
to_run_when_initialized_.size(), 0, 100, 20);
+ SIMPLE_CACHE_UMA(CUSTOM_COUNTS, "IndexNumEntriesOnInit", cache_type_,
+ entries_set_.size(), 0, 100000, 50);
+ SIMPLE_CACHE_UMA(
+ MEMORY_KB, "CacheSizeOnInit", cache_type_,
+ static_cast<base::HistogramBase::Sample>(cache_size_ / kBytesInKb));
+ SIMPLE_CACHE_UMA(
+ MEMORY_KB, "MaxCacheSizeOnInit", cache_type_,
+ static_cast<base::HistogramBase::Sample>(max_size_ / kBytesInKb));
+ if (max_size_ > 0) {
+ SIMPLE_CACHE_UMA(PERCENTAGE, "PercentFullOnInit", cache_type_,
+ static_cast<base::HistogramBase::Sample>(
+ (cache_size_ * 100) / max_size_));
+ }
+
// Run all callbacks waiting for the index to come up.
for (CallbackList::iterator it = to_run_when_initialized_.begin(),
end = to_run_when_initialized_.end(); it != end; ++it) {
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698