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

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

Issue 1131493005: Add UMA histogram DomDistiller.Time.DistillPage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix naming Created 5 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 | « components/dom_distiller/core/distiller_page.h ('k') | 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 b8bcd28ff8ea524faed199e3a185be1c86dfd71c..8eb6585a2acfc22120ec29a55d995a128e36ed81 100644
--- a/components/dom_distiller/core/distiller_page.cc
+++ b/components/dom_distiller/core/distiller_page.cc
@@ -88,6 +88,7 @@ void DistillerPage::DistillPage(
// the callback to OnDistillationDone happens.
ready_ = false;
distiller_page_callback_ = callback;
+ distillation_start_ = base::TimeTicks::Now();
DistillPageImpl(gurl, GetDistillerScriptWithOptions(options,
StringifyOutput(),
CreateNewContext()));
@@ -110,6 +111,11 @@ void DistillerPage::OnDistillationDone(const GURL& page_url,
if (!found_content) {
DVLOG(1) << "Unable to parse DomDistillerResult.";
} else {
+ base::TimeDelta distillation_time =
+ base::TimeTicks::Now() - distillation_start_;
+ UMA_HISTOGRAM_TIMES("DomDistiller.Time.DistillPage", distillation_time);
+ VLOG(1) << "DomDistiller.Time.DistillPage = " << distillation_time;
Mark P 2015/05/11 18:27:10 minor comment: do you actually need these VLOGs ar
wychen 2015/05/11 20:42:49 Thanks for your review! I used LOG(ERROR) locally
+
if (distiller_result->has_timing_info()) {
const dom_distiller::proto::TimingInfo& timing =
distiller_result->timing_info();
@@ -139,6 +145,8 @@ void DistillerPage::OnDistillationDone(const GURL& page_url,
UMA_HISTOGRAM_TIMES(
"DomDistiller.Time.DistillationTotal",
base::TimeDelta::FromMillisecondsD(timing.total_time()));
+ VLOG(1) << "DomDistiller.Time.DistillationTotal = " <<
+ base::TimeDelta::FromMillisecondsD(timing.total_time());
}
}
if (distiller_result->has_statistics_info()) {
« no previous file with comments | « components/dom_distiller/core/distiller_page.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698