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

Unified Diff: components/ntp_snippets/content_suggestions_metrics.cc

Issue 2563443004: Adds histograms for collecting data about Zine usage for each day of the week. (Closed)
Patch Set: rebase Created 4 years 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/ntp_snippets/content_suggestions_metrics.cc
diff --git a/components/ntp_snippets/content_suggestions_metrics.cc b/components/ntp_snippets/content_suggestions_metrics.cc
index cb97256bd8c9cf5d2ba7881c56754fc24dec08d6..33d61743ca4a5a31b617d7eda8f0842074a26c4f 100644
--- a/components/ntp_snippets/content_suggestions_metrics.cc
+++ b/components/ntp_snippets/content_suggestions_metrics.cc
@@ -213,8 +213,14 @@ void RecordContentSuggestionsUsage() {
base::Time::Exploded now_exploded;
base::Time::Now().LocalExplode(&now_exploded);
- size_t bucket =
- (now_exploded.hour * 60 + now_exploded.minute) / kBucketSizeMins;
+ int bucket = (now_exploded.hour * 60 + now_exploded.minute) / kBucketSizeMins;
+
+ const char* kWeekdayNames[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
+ "Thursday", "Friday", "Saturday"};
+ std::string histogram_name(
+ base::StringPrintf("%s.%s", kHistogramArticlesUsageTimeLocal,
+ kWeekdayNames[now_exploded.day_of_week]));
+ UmaHistogramEnumeration(histogram_name, bucket, kNumBuckets);
UMA_HISTOGRAM_ENUMERATION(kHistogramArticlesUsageTimeLocal, bucket,
kNumBuckets);
« 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