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

Unified Diff: content/browser/browser_main_runner.cc

Issue 1359163004: Add Histograms to Measure Time in BrowserMainRunnerImpl::Initialize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_main_runner.cc
diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc
index c7c805866569719544cdb89c1e5b793aae2ec8ed..b19fc6950ba1162569f63bee28d6cbea40e36850 100644
--- a/content/browser/browser_main_runner.cc
+++ b/content/browser/browser_main_runner.cc
@@ -9,9 +9,11 @@
#include "base/debug/leak_annotations.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
+#include "base/metrics/histogram_macros.h"
#include "base/metrics/statistics_recorder.h"
#include "base/profiler/scoped_profile.h"
#include "base/profiler/scoped_tracker.h"
+#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "base/tracked_objects.h"
#include "components/tracing/trace_config_file.h"
@@ -138,6 +140,9 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
}
int Initialize(const MainFunctionParams& parameters) override {
+ SCOPED_UMA_HISTOGRAM_LONG_TIMER(
+ "Startup.BrowserMainRunnerImplInitializeLongTime");
+
// TODO(vadimt, yiyaoliu): Remove all tracked_objects references below once
// crbug.com/453640 is fixed.
tracked_objects::ThreadData::InitializeThreadContext("CrBrowserMain");
@@ -152,6 +157,8 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
if (!initialization_started_) {
initialization_started_ = true;
+ const base::TimeTicks start_time_step1 = base::TimeTicks::Now();
+
SkGraphics::Init();
#if !defined(OS_IOS)
@@ -206,12 +213,18 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
// to browser_shutdown::Shutdown or BrowserProcess::EndSession.
ui::InitializeInputMethod();
+ UMA_HISTOGRAM_TIMES("Startup.BrowserMainRunnerImplInitializeStep1Time",
+ base::TimeTicks::Now() - start_time_step1);
}
+ const base::TimeTicks start_time_step2 = base::TimeTicks::Now();
main_loop_->CreateStartupTasks();
int result_code = main_loop_->GetResultCode();
if (result_code > 0)
return result_code;
+ UMA_HISTOGRAM_TIMES("Startup.BrowserMainRunnerImplInitializeStep2Time",
+ base::TimeTicks::Now() - start_time_step2);
+
// Return -1 to indicate no early termination.
return -1;
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698