Index: components/dom_distiller/core/distiller_page.cc |
diff --git a/components/dom_distiller/core/distiller_page.cc b/components/dom_distiller/core/distiller_page.cc |
index 462a79ab54f787bc68da6270121191d49595e43f..f9f1dcc3bfe1c0f0e8dc8d463cba0cbd1664b8dc 100644 |
--- a/components/dom_distiller/core/distiller_page.cc |
+++ b/components/dom_distiller/core/distiller_page.cc |
@@ -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( |