Commit 49e25f54 authored by yfriedman's avatar yfriedman Committed by Commit bot

Record histograms for timing information in DomDistiller.

https://codereview.chromium.org/499623002/ adds timing diagnostics to
DomDistiller. Report histograms for these to help measure real-world
perf.

Also includes a boolean histogram for distillability based on code from internal repo.

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

Cr-Commit-Position: refs/heads/master@{#292282}
parent b4351227
......@@ -8,8 +8,10 @@
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "grit/component_resources.h"
#include "third_party/dom_distiller_js/dom_distiller.pb.h"
#include "third_party/dom_distiller_js/dom_distiller_json_converter.h"
......@@ -137,6 +139,37 @@ void DistillerPage::OnDistillationDone(const GURL& page_url,
dst_image.height = src_image.height();
dst_markup_info.images.push_back(dst_image);
}
if (distiller_result.has_timing_info()) {
const dom_distiller::proto::TimingInfo& timing =
distiller_result.timing_info();
if (timing.has_markup_parsing_time()) {
UMA_HISTOGRAM_TIMES(
"DomDistiller.Time.MarkupParsing",
base::TimeDelta::FromMillisecondsD(timing.markup_parsing_time()));
}
if (timing.has_document_construction_time()) {
UMA_HISTOGRAM_TIMES(
"DomDistiller.Time.DocumentConstruction",
base::TimeDelta::FromMillisecondsD(
timing.document_construction_time()));
}
if (timing.has_article_processing_time()) {
UMA_HISTOGRAM_TIMES(
"DomDistiller.Time.ArticleProcessing",
base::TimeDelta::FromMillisecondsD(
timing.article_processing_time()));
}
if (timing.has_formatting_time()) {
UMA_HISTOGRAM_TIMES(
"DomDistiller.Time.Formatting",
base::TimeDelta::FromMillisecondsD(timing.formatting_time()));
}
if (timing.has_total_time()) {
UMA_HISTOGRAM_TIMES(
"DomDistiller.Time.DistillationTotal",
base::TimeDelta::FromMillisecondsD(timing.total_time()));
}
}
}
base::MessageLoop::current()->PostTask(
......
......@@ -5005,6 +5005,48 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>
<histogram name="DomDistiller.PageDistillable" enum="BooleanDistillable">
<owner>yfriedman@chromium.org</owner>
<summary>
Records the number of times a page was loaded for which using DomDistiller
is possible.
</summary>
</histogram>
<histogram name="DomDistiller.Time.ArticleProcessing" units="milliseconds">
<owner>yfriedman@chromium.org</owner>
<summary>
Time spent in DomDistiller's identification of text content.
</summary>
</histogram>
<histogram name="DomDistiller.Time.DistillationTotal" units="milliseconds">
<owner>yfriedman@chromium.org</owner>
<summary>Complete time spent in DomDistiller's processing of a page.</summary>
</histogram>
<histogram name="DomDistiller.Time.DocumentConstruction" units="milliseconds">
<owner>yfriedman@chromium.org</owner>
<summary>
Time spent in creating DomDistiller's internal representation of the HTML
document.
</summary>
</histogram>
<histogram name="DomDistiller.Time.Formatting" units="milliseconds">
<owner>yfriedman@chromium.org</owner>
<summary>
Time spent in DomDistiller's final processing of article content/formatting.
</summary>
</histogram>
<histogram name="DomDistiller.Time.MarkupParsing" units="milliseconds">
<owner>yfriedman@chromium.org</owner>
<summary>
Time spent in DomDistiller's processing of article metadata.
</summary>
</histogram>
<histogram name="DOMStorage.clear" units="milliseconds">
<owner>michaeln@chromium.org</owner>
<summary>
......@@ -37914,6 +37956,11 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="1" label="Did evict"/>
</enum>
<enum name="BooleanDistillable" type="int">
<int value="0" label="Not distillable"/>
<int value="1" label="Distillable"/>
</enum>
<enum name="BooleanDuplicate" type="int">
<int value="0" label="Not Duplicate"/>
<int value="1" label="Duplicate"/>
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