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

Unified Diff: components/dom_distiller/content/browser/dom_distiller_viewer_source.cc

Issue 2011213002: Record start up latency of DOM distiller viewer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
diff --git a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
index 31735df89753dd807c896debdf04c61085b4288b..12f679d322d34b091773a4bd7a22e9229c0e9253 100644
--- a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
+++ b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
@@ -11,7 +11,7 @@
#include "base/memory/ref_counted_memory.h"
#include "base/message_loop/message_loop.h"
-#include "base/metrics/user_metrics.h"
+#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -157,6 +157,15 @@ void DomDistillerViewerSource::RequestViewerHandle::DidFinishLoad(
return;
}
+ int64_t start_time_ms = url_utils::GetTimeFromDistillerUrl(validated_url);
+ if (start_time_ms > 0) {
+ base::TimeTicks start_time =
+ base::TimeDelta::FromMilliseconds(start_time_ms) + base::TimeTicks();
+ base::TimeDelta latency = base::TimeTicks::Now() - start_time;
+
+ UMA_HISTOGRAM_TIMES("DomDistiller.Time.ViewerLoading", latency);
+ }
+
// No SendJavaScript() calls allowed before |buffer_| is run and cleared.
waiting_for_page_ready_ = false;
if (!buffer_.empty()) {

Powered by Google App Engine
This is Rietveld 408576698