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

Unified Diff: components/dom_distiller/content/renderer/distillability_agent.cc

Issue 1984853002: Record detailed breakdown of Reader Mode triggering (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@2704
Patch Set: Created 4 years, 7 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/dom_distiller/content/renderer/distillability_agent.cc
diff --git a/components/dom_distiller/content/renderer/distillability_agent.cc b/components/dom_distiller/content/renderer/distillability_agent.cc
index 93e37361d9f0b01d1a066909ba08a7e9e5508cb3..6caeaf7b9b25e47bb75f1553039f566ef409e9b7 100644
--- a/components/dom_distiller/content/renderer/distillability_agent.cc
+++ b/components/dom_distiller/content/renderer/distillability_agent.cc
@@ -27,6 +27,15 @@ const char* const kBlacklist[] = {
"www.reddit.com"
};
+enum RejectionBuckets {
+ NOT_ARTICLE = 0,
+ MOBILE_FRIENDLY,
+ BLACKLISTED,
+ TOO_SHORT,
+ NOT_REJECTED,
+ REJECTION_BUCKET_BOUNDARY
+};
+
// Returns whether it is necessary to send updates back to the browser.
// The number of updates can be from 0 to 2. See the tests in
// "distillable_page_utils_browsertest.cc".
@@ -94,6 +103,22 @@ bool IsDistillablePageAdaboost(WebDocument& doc,
} else {
UMA_HISTOGRAM_ENUMERATION("DomDistiller.PageDistillableAfterParsing",
bucket, 4);
+ if (!distillable) {
+ UMA_HISTOGRAM_ENUMERATION("DomDistiller.DistillabilityRejection",
+ NOT_ARTICLE, REJECTION_BUCKET_BOUNDARY);
+ } else if (features.isMobileFriendly) {
+ UMA_HISTOGRAM_ENUMERATION("DomDistiller.DistillabilityRejection",
+ MOBILE_FRIENDLY, REJECTION_BUCKET_BOUNDARY);
+ } else if (blacklisted) {
+ UMA_HISTOGRAM_ENUMERATION("DomDistiller.DistillabilityRejection",
+ BLACKLISTED, REJECTION_BUCKET_BOUNDARY);
+ } else if (!long_article) {
+ UMA_HISTOGRAM_ENUMERATION("DomDistiller.DistillabilityRejection",
+ TOO_SHORT, REJECTION_BUCKET_BOUNDARY);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION("DomDistiller.DistillabilityRejection",
+ NOT_REJECTED, REJECTION_BUCKET_BOUNDARY);
+ }
}
if (blacklisted) {
« 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