Commit 69231d04 authored by kuan's avatar kuan Committed by Commit bot

add UMA to record if a page has distilled data.

BUG=418190

Review URL: https://codereview.chromium.org/607013003

Cr-Commit-Position: refs/heads/master@{#297100}
parent 2133f1b2
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/json/json_writer.h" #include "base/json/json_writer.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "components/dom_distiller/core/distilled_page_prefs.h" #include "components/dom_distiller/core/distilled_page_prefs.h"
#include "components/dom_distiller/core/dom_distiller_service.h" #include "components/dom_distiller/core/dom_distiller_service.h"
...@@ -92,6 +93,7 @@ const std::string GetFontCssClass(DistilledPagePrefs::FontFamily font_family) { ...@@ -92,6 +93,7 @@ const std::string GetFontCssClass(DistilledPagePrefs::FontFamily font_family) {
void EnsureNonEmptyTitleAndContent(std::string* title, std::string* content) { void EnsureNonEmptyTitleAndContent(std::string* title, std::string* content) {
if (title->empty()) if (title->empty())
*title = l10n_util::GetStringUTF8(IDS_DOM_DISTILLER_VIEWER_NO_DATA_TITLE); *title = l10n_util::GetStringUTF8(IDS_DOM_DISTILLER_VIEWER_NO_DATA_TITLE);
UMA_HISTOGRAM_BOOLEAN("DomDistiller.PageHasDistilledData", !content->empty());
if (content->empty()) { if (content->empty()) {
*content = l10n_util::GetStringUTF8( *content = l10n_util::GetStringUTF8(
IDS_DOM_DISTILLER_VIEWER_NO_DATA_CONTENT); IDS_DOM_DISTILLER_VIEWER_NO_DATA_CONTENT);
......
...@@ -5113,6 +5113,12 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -5113,6 +5113,12 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary> </summary>
</histogram> </histogram>
<histogram name="DomDistiller.PageHasDistilledData"
enum="BooleanHasDistilledData">
<owner>kuan@chromium.org</owner>
<summary>Records whether a page has distilled data.</summary>
</histogram>
<histogram name="DomDistiller.Statistics.WordCount" units="words"> <histogram name="DomDistiller.Statistics.WordCount" units="words">
<owner>nyquist@chromium.org</owner> <owner>nyquist@chromium.org</owner>
<summary> <summary>
...@@ -39124,6 +39130,11 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -39124,6 +39130,11 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="1" label="Has CRC"/> <int value="1" label="Has CRC"/>
</enum> </enum>
<enum name="BooleanHasDistilledData" type="int">
<int value="0" label="No distilled data"/>
<int value="1" label="Has distilled data"/>
</enum>
<enum name="BooleanHit" type="int"> <enum name="BooleanHit" type="int">
<int value="0" label="Not_reached"/> <int value="0" label="Not_reached"/>
<int value="1" label="Hit"/> <int value="1" label="Hit"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment