Example #1
0
 public Experiment(GoogleExperiment experiment)
 {
     GoogleExperiment = experiment;
     if (TryParseUSplitExperimentName(experiment.Name, out var nodeId, out var name))
     {
         IsUSplitExperiment = true;
         Name          = name;
         ServerSide    = nodeId == -1;
         Configuration = ParseSettings(experiment.Description);
     }
Example #2
0
        public static string UpdateSettings(string description, ExperimentConfiguration settings)
        {
            var userText          = description ?? string.Empty;
            var separatorPosition = userText.IndexOf(DescriptionSeparator, StringComparison.InvariantCultureIgnoreCase);

            if (separatorPosition > -1)
            {
                userText = userText.Substring(0, separatorPosition);
            }
            var serializedConfig = JsonConvert.SerializeObject(settings);

            return($"{userText}\n{DescriptionSeparator}\n{serializedConfig}");
        }
Example #3
0
 private void ParseGoogleData(GoogleExperiment experiment)
 {
     Configuration = ParseSettings(experiment.Description);
     Variations    = ParseVariations(experiment);
 }