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

Unified Diff: net/disk_cache/blockfile/webfonts_histogram.cc

Issue 323013003: Add histograms to track age of cache entries for web fonts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use entry->GetKey() Created 6 years, 6 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/blockfile/webfonts_histogram.cc
diff --git a/net/disk_cache/blockfile/webfonts_histogram.cc b/net/disk_cache/blockfile/webfonts_histogram.cc
index ad157176cd8250b58963a2d85c91aff73c9eddc7..a92d94224ec11b8a479f5f0b5699e8dd7db74ea7 100644
--- a/net/disk_cache/blockfile/webfonts_histogram.cc
+++ b/net/disk_cache/blockfile/webfonts_histogram.cc
@@ -78,21 +78,27 @@ void RecordEvictedEntry(const std::string& key) {
}
void RecordCacheHit(EntryImpl* entry) {
- const char* label = HistogramLabel(entry->entry()->Data()->key);
+ const char* label = HistogramLabel(entry->GetKey());
if (!label)
return;
+ EntryStore* info = entry->entry()->Data();
CACHE_HISTOGRAM_COUNTS_10000(HistogramName("DiskCache.ReuseCount.Hit", label),
- entry->entry()->Data()->reuse_count);
+ info->reuse_count);
+ CACHE_HISTOGRAM_AGE(HistogramName("DiskCache.EntryAge.Hit", label),
+ base::Time::FromInternalValue(info->creation_time));
RecordCacheEvent(CACHE_EVENT_HIT, label);
}
void RecordEviction(EntryImpl* entry) {
- const char* label = HistogramLabel(entry->entry()->Data()->key);
- if (label)
+ const char* label = HistogramLabel(entry->GetKey());
+ if (!label)
return;
+ EntryStore* info = entry->entry()->Data();
CACHE_HISTOGRAM_COUNTS_10000(
HistogramName("DiskCache.ReuseCount.Evict", label),
- entry->entry()->Data()->reuse_count);
+ info->reuse_count);
+ CACHE_HISTOGRAM_AGE(HistogramName("DiskCache.EntryAge.Evict", label),
+ base::Time::FromInternalValue(info->creation_time));
}
} // namespace web_fonts_histogram
« 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