Commit 042b047e authored by asvitkine's avatar asvitkine Committed by Commit bot

Make 50% of canary users not run any server experiments.

Changing previous experiment that made 50% of users on canary
use stable configs to instead not create any experiments.

Experimenting with this to see impact of experiments on
stability.

BUG=421481

Review URL: https://codereview.chromium.org/662663002

Cr-Commit-Position: refs/heads/master@{#299925}
parent 019725ec
...@@ -61,25 +61,57 @@ const int kMaxRetrySeedFetch = 5; ...@@ -61,25 +61,57 @@ const int kMaxRetrySeedFetch = 5;
// For the HTTP date headers, the resolution of the server time is 1 second. // For the HTTP date headers, the resolution of the server time is 1 second.
const int64 kServerTimeResolutionMs = 1000; const int64 kServerTimeResolutionMs = 1000;
// Experimentally makes 50% of genuine Canary users Stable variation configs, // Name of the field trial to control which experiments Canary users use.
// to determine impact on stability. The field trial is set up in the client const char kChannelOverrideTrialName[] = "UMA-Variations-ChannelOverride";
// code because it has to run before server-side configs are processed and is // This is the default behavior.
// created the first time the function is called. const char kNoOverrideGroupName[] = "NoOverride";
variations::Study_Channel GetOverrideCanaryChannel() { // Users in this group get Stable variation configs.
static variations::Study_Channel override_channel = const char kStableOverrideGroupName[] = "StableOverride";
variations::Study_Channel_UNKNOWN; // Users in this group do not create any field trials from variation configs.
if (override_channel == variations::Study_Channel_UNKNOWN) { const char kNoExperimentsGroupName[] = "NoExperiments";
// Creates a field trial the first time it's called to control how Canary will
// evaluate experiment configs, to determine impact on stability. Currently,
// this makes 50% of Canary users not use server side experiments. The field
// trial is set up in the client code because it has to run before server-side
// configs are processed.
void CreateChannelOverrideFieldTrial() {
static bool created = false;
if (!created) {
scoped_refptr<base::FieldTrial> trial( scoped_refptr<base::FieldTrial> trial(
base::FieldTrialList::FactoryGetFieldTrial( base::FieldTrialList::FactoryGetFieldTrial(
"UMA-Variations-ChannelOverride", 100, "NoOverride", 2015, 1, 1, kChannelOverrideTrialName, 100, kNoOverrideGroupName, 2015, 1, 1,
base::FieldTrial::SESSION_RANDOMIZED, NULL)); base::FieldTrial::SESSION_RANDOMIZED, NULL));
// Currently, experimenting with 50% no experiments and 50% default, with
static const char kStableOverrideGroup[] = "StableOverride"; // the |kStableOverrideGroupName| intentionally at 0 for now.
trial->AppendGroup(kStableOverrideGroup, 50); trial->AppendGroup(kStableOverrideGroupName, 0);
override_channel = (trial->group_name() == kStableOverrideGroup) ? trial->AppendGroup(kNoExperimentsGroupName, 50);
variations::Study_Channel_STABLE : variations::Study_Channel_CANARY; created = true;
} }
return override_channel; }
// Returns the group name of the channel override field trial.
std::string GetChannelOverrideFieldTrialGroup() {
return base::FieldTrialList::FindFullName(kChannelOverrideTrialName);
}
// Whether field trials should be created from server configs.
bool ShouldCreateServerTrials() {
// Always use server trials if not on Canary.
if (chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_CANARY)
return true;
// On Canary, use server trials unless in |kNoExperimentsGroupName| group.
CreateChannelOverrideFieldTrial();
return GetChannelOverrideFieldTrialGroup() != kNoExperimentsGroupName;
}
// Returns the channel that should be on for evaluating variation configs when
// running the Canary version, based on an experiment.
variations::Study_Channel GetOverrideCanaryChannel() {
CreateChannelOverrideFieldTrial();
if (GetChannelOverrideFieldTrialGroup() == kStableOverrideGroupName)
return variations::Study_Channel_STABLE;
return variations::Study_Channel_CANARY;
} }
// Wrapper around channel checking, used to enable channel mocking for // Wrapper around channel checking, used to enable channel mocking for
...@@ -287,15 +319,17 @@ bool VariationsService::CreateTrialsFromSeed() { ...@@ -287,15 +319,17 @@ bool VariationsService::CreateTrialsFromSeed() {
variations::Study_Channel channel = GetChannelForVariations(); variations::Study_Channel channel = GetChannelForVariations();
UMA_HISTOGRAM_SPARSE_SLOWLY("Variations.UserChannel", channel); UMA_HISTOGRAM_SPARSE_SLOWLY("Variations.UserChannel", channel);
variations::VariationsSeedProcessor().CreateTrialsFromSeed( if (ShouldCreateServerTrials()) {
seed, variations::VariationsSeedProcessor().CreateTrialsFromSeed(
g_browser_process->GetApplicationLocale(), seed,
GetReferenceDateForExpiryChecks(local_state_), g_browser_process->GetApplicationLocale(),
current_version, GetReferenceDateForExpiryChecks(local_state_),
channel, current_version,
GetCurrentFormFactor(), channel,
GetHardwareClass(), GetCurrentFormFactor(),
base::Bind(&OverrideUIString)); GetHardwareClass(),
base::Bind(&OverrideUIString));
}
const base::Time now = base::Time::Now(); const base::Time now = base::Time::Now();
...@@ -624,6 +658,9 @@ void VariationsService::PerformSimulationWithVersion( ...@@ -624,6 +658,9 @@ void VariationsService::PerformSimulationWithVersion(
if (!version.IsValid()) if (!version.IsValid())
return; return;
if (!ShouldCreateServerTrials())
return;
const base::ElapsedTimer timer; const base::ElapsedTimer timer;
scoped_ptr<const base::FieldTrial::EntropyProvider> entropy_provider = scoped_ptr<const base::FieldTrial::EntropyProvider> entropy_provider =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment