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

Unified Diff: components/precache/core/precache_fetcher.cc

Issue 2735923002: Add Precache.Fetch.ResponseBytes.Daily. (Closed)
Patch Set: Created 3 years, 9 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: components/precache/core/precache_fetcher.cc
diff --git a/components/precache/core/precache_fetcher.cc b/components/precache/core/precache_fetcher.cc
index bab9bc580b1bc06ae111b212dc253cf0e62cdcf1..1cbf787acf2612f45b6c2dcd80a7d371a61c03d6 100644
--- a/components/precache/core/precache_fetcher.cc
+++ b/components/precache/core/precache_fetcher.cc
@@ -718,6 +718,12 @@ void PrecacheFetcher::OnQuotaInfoRetrieved(const PrecacheQuota& quota) {
quota_ = quota;
base::Time time_now = base::Time::Now();
if (IsQuotaTimeExpired(quota_, time_now)) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Precache.Fetch.ResponseBytes.Daily",
+ unfinished_work_->config_settings().daily_quota_total() -
+ quota_.remaining(),
jamartin 2017/03/07 21:10:12 (opt) It would be nice to have a bit more document
twifkak 2017/03/07 21:45:09 Done.
+ 1, kMaxResponseBytes, 100);
jamartin 2017/03/07 21:10:12 I assume you eyeballed the bucket values and they
twifkak 2017/03/07 21:45:09 Yes. The max is 500MB, which is more than enough f
+
// This is a new day. Update daily quota, that starts today and expires by
// end of today.
jamartin 2017/03/07 21:10:12 Keep the comment at the beginning of the if block.
twifkak 2017/03/07 21:45:09 Done.
quota_.set_start_time(time_now.LocalMidnight().ToInternalValue());
« 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