Index: components/startup_metric_utils/browser/startup_metric_utils.cc |
diff --git a/components/startup_metric_utils/browser/startup_metric_utils.cc b/components/startup_metric_utils/browser/startup_metric_utils.cc |
index 3f4144721d8c73ce73275ca3cc7232397f70ee1c..32acf5b39244ddc0b96b97f46f849e794c4a31f4 100644 |
--- a/components/startup_metric_utils/browser/startup_metric_utils.cc |
+++ b/components/startup_metric_utils/browser/startup_metric_utils.cc |
@@ -314,6 +314,8 @@ void RecordMainEntryTimeHistogram() { |
(browser_main_entry_time_raw_ms >> 1) & kLower31BitsMask); |
// A timestamp is a 64 bit value, yet histograms can only store 32 bits. |
+ // TODO(gabadie): Once startup_with_url.* benchmarks are replaced by |
gab
2015/11/12 14:41:38
Please add bug#
gabadie
2015/11/12 17:43:34
Done.
|
+ // startup_with_url2.*, remove this dirty hack. |
LOCAL_HISTOGRAM_TIMES("Startup.BrowserMainEntryTimeAbsoluteHighWord", |
browser_main_entry_time_raw_ms_high_word); |
LOCAL_HISTOGRAM_TIMES("Startup.BrowserMainEntryTimeAbsoluteLowWord", |
@@ -337,6 +339,20 @@ base::TimeTicks ExeMainEntryPointTicks() { |
return base::TimeTicks(); |
} |
+// Records "instant" trace events for global timings observed by telemetry. |
+void AddStartupEventsForTelemetry() { |
+ DCHECK(!g_process_creation_ticks.Get().is_null()); |
+ DCHECK(!g_main_entry_point_ticks.Get().is_null()); |
+ |
+ TRACE_EVENT_INSTANT_WITH_TIMESTAMP( |
+ "startup", "Startup.BrowserProcessCreation", 0, |
+ g_process_creation_ticks.Get().ToInternalValue()); |
+ |
+ TRACE_EVENT_INSTANT_WITH_TIMESTAMP( |
+ "startup", "Startup.BrowserMainEntryPoint", 0, |
+ g_main_entry_point_ticks.Get().ToInternalValue()); |
+} |
gab
2015/11/12 14:41:38
Also, FYI going forward, I think telemetry should
gabadie
2015/11/12 17:43:33
Telemetry w'll use thoses values to diff to other
|
+ |
} // namespace |
bool WasNonBrowserUIDisplayed() { |
@@ -374,6 +390,7 @@ void RecordExeMainEntryPointTime(const base::Time& time) { |
void RecordBrowserMainMessageLoopStart(const base::TimeTicks& ticks, |
bool is_first_run) { |
+ AddStartupEventsForTelemetry(); |
RecordHardFaultHistogram(is_first_run); |
RecordMainEntryTimeHistogram(); |