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()) { |