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

Unified Diff: chrome/browser/browser_main_win.cc

Issue 7508034: Make a pre-read A/B field-trial (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | « chrome/browser/browser_main_win.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_main_win.cc
===================================================================
--- chrome/browser/browser_main_win.cc (revision 95298)
+++ chrome/browser/browser_main_win.cc (working copy)
@@ -90,12 +90,9 @@
::GetProcessTimes(::GetCurrentProcess(), &creation_time, &ignore, &ignore,
&ignore);
- base::TimeDelta elapsed_from_startup =
- base::Time::Now() - base::Time::FromFileTime(creation_time);
-
- // Record the time to present in a histogram.
- UMA_HISTOGRAM_MEDIUM_TIMES("Startup.BrowserMessageLoopStartTime",
- elapsed_from_startup);
+ RecordPreReadExperimentTime(
+ "Startup.BrowserMessageLoopStartTime",
+ base::Time::Now() - base::Time::FromFileTime(creation_time));
}
int AskForUninstallConfirmation() {
@@ -276,6 +273,31 @@
return false;
}
+// This code is specific to the Windows-only PreReadExperiment field-trial.
+void RecordPreReadExperimentTime(const char* name, base::TimeDelta time) {
+ DCHECK(name != NULL);
+
+ static const char kEnvVar[] = "CHROME_PRE_READ_EXPERIMENT";
+ static const base::TimeDelta kMin(base::TimeDelta::FromMilliseconds(1));
+ static const base::TimeDelta kMax(base::TimeDelta::FromHours(1));
+ static const size_t kBuckets(100);
+
+ UMA_HISTOGRAM_CUSTOM_TIMES(name, time, kMin, kMax, kBuckets);
jar (doing other things) 2011/08/04 18:34:28 Am I mistaken, or is this function called with two
chrisha 2011/08/04 18:50:33 No, you're not mistaken, that's exactly what its d
jar (doing other things) 2011/08/04 19:11:03 Be sure to run under Debug, as it would have diagn
+
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ DCHECK(env.get() != NULL);
+
+ // Only record the sub-histogram result if the experiment is running
+ // (environment variable is set, and valid).
+ std::string pre_read;
+ if (env->GetVar(kEnvVar, &pre_read) && (pre_read == "0" || pre_read == "1")) {
+ std::string uma_name(name);
+ uma_name += "_PreRead";
+ uma_name += pre_read == "1" ? "Enabled" : "Disabled";
+ UMA_HISTOGRAM_CUSTOM_TIMES(uma_name.c_str(), time, kMin, kMax, kBuckets);
+ }
+}
+
// BrowserMainPartsWin ---------------------------------------------------------
class BrowserMainPartsWin : public BrowserMainParts {
« no previous file with comments | « chrome/browser/browser_main_win.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698