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

Unified Diff: components/dom_distiller/core/distiller_page.cc

Issue 501553002: Record histograms for timing information in DomDistiller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/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(
« 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