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

Unified Diff: components/startup_metric_utils/browser/startup_metric_utils.cc

Issue 1410943005: Implements AddStartupEventsForTelemetry() in startup_metric_utils.cc for in-coming startup telemetry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b00
Patch Set: Fixes miss leading instant events caused by patch set #14 Created 5 years, 1 month 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 | « base/trace_event/common/trace_event_common.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 03760ca0733a8c06b5920ee6f59f31b678e8f8b1..9fd7d911ae0d256bcb9acba29c430e88f0c6e820 100644
--- a/components/startup_metric_utils/browser/startup_metric_utils.cc
+++ b/components/startup_metric_utils/browser/startup_metric_utils.cc
@@ -319,6 +319,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
+ // startup_with_url2.*, remove this dirty hack (crbug.com/539287).
LOCAL_HISTOGRAM_TIMES("Startup.BrowserMainEntryTimeAbsoluteHighWord",
browser_main_entry_time_raw_ms_high_word);
LOCAL_HISTOGRAM_TIMES("Startup.BrowserMainEntryTimeAbsoluteLowWord",
@@ -357,6 +359,22 @@ base::TimeTicks ExeMainEntryPointTicks() {
return base::TimeTicks();
}
+void AddStartupEventsForTelemetry()
+{
+ DCHECK(!g_browser_main_entry_point_ticks.Get().is_null());
+
+ TRACE_EVENT_INSTANT_WITH_TIMESTAMP0(
+ "startup", "Startup.BrowserMainEntryPoint", 0,
+ g_browser_main_entry_point_ticks.Get().ToInternalValue());
+
+ if (!g_process_creation_ticks.Get().is_null())
+ {
+ TRACE_EVENT_INSTANT_WITH_TIMESTAMP0(
+ "startup", "Startup.BrowserProcessCreation", 0,
+ g_process_creation_ticks.Get().ToInternalValue());
+ }
+}
+
} // namespace
bool WasNonBrowserUIDisplayed() {
@@ -394,6 +412,7 @@ void RecordExeMainEntryPointTime(const base::Time& time) {
void RecordBrowserMainMessageLoopStart(const base::TimeTicks& ticks,
bool is_first_run) {
+ AddStartupEventsForTelemetry();
RecordHardFaultHistogram(is_first_run);
RecordMainEntryTimeHistogram();
« no previous file with comments | « base/trace_event/common/trace_event_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698