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

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: Patchs split up (only chromium side changes) + gab's review fix 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 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();
« 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