1// Copyright (c) 2012 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5syntax = "proto2"; 6 7option optimize_for = LITE_RUNTIME; 8 9package chrome_variations; 10 11// This defines the Protocol Buffer representation of a Chrome Variations study 12// as sent to clients of the Variations server. 13// 14// Next tag: 13 15message Study { 16 // The name of the study. Should not contain spaces or special characters. 17 // Ex: "my_study" 18 required string name = 1; 19 20 // The expiry date of the study in Unix time format. (Seconds since midnight 21 // January 1, 1970 UTC). See: http://en.wikipedia.org/wiki/Unix_time 22 // 23 // A study that has expired will be disabled, which will take precedence over 24 // a corresponding hardcoded field trial in the client. 25 // 26 // Ex: 1330893974 (corresponds to 2012-03-04 20:46:14Z) 27 optional int64 expiry_date = 3; 28 29 // Consistency setting for a study. 30 enum Consistency { 31 SESSION = 0; // Can't change within a session. 32 PERMANENT = 1; // Can't change for a given user. 33 } 34 35 // Consistency setting for this study. Optional - defaults to SESSION. 36 // Ex: PERMANENT 37 optional Consistency consistency = 7 [default = SESSION]; 38 39 // Name of the experiment that gets the default experience. This experiment 40 // must be included in the list below. 41 // Ex: "default" 42 optional string default_experiment_name = 8; 43 44 // An experiment within the study. 45 // 46 // Next tag: 9 47 message Experiment { 48 // A named parameter value for this experiment. 49 // 50 // Next tag: 3 51 message Param { 52 // The name of the parameter. 53 optional string name = 1; 54 55 // The value of the parameter. 56 optional string value = 2; 57 } 58 59 // The name of the experiment within the study. 60 // Ex: "bucketA" 61 required string name = 1; 62 63 // The cut of the total probability taken for this experiment (the x in 64 // x / N, where N is the sum of all x’s). Ex: "50" 65 required uint32 probability_weight = 2; 66 67 // Optional id used to uniquely identify this experiment for Google web 68 // properties. 69 optional uint64 google_web_experiment_id = 3; 70 71 // Optional id used to allow this experiment to trigger experimental 72 // behavior on Google web properties. 73 optional uint64 google_web_trigger_experiment_id = 8; 74 75 // Optional id used to uniquely identify this experiment for Google Update. 76 optional uint64 google_update_experiment_id = 4; 77 78 // Optional name of a Chrome flag that, when present, causes this experiment 79 // to be forced. If the forcing_flag field is set, users will not be 80 // assigned to this experiment unless that flag is present in Chrome's 81 // command line. 82 optional string forcing_flag = 5; 83 84 // Parameter values for this experiment. 85 repeated Param param = 6; 86 87 enum Type { 88 // Regular experiment group. This is the default value and can be omitted. 89 NORMAL = 0; 90 91 // Changes to this experiment group are ignored for the purposes of 92 // kill-switch triggering. Included to allow the flexibility to not 93 // trigger this logic for specific cases (e.g. a group rename without 94 // any functionality changes). 95 IGNORE_CHANGE = 1; 96 97 // This is a kill-switch group that should be killed at "best effort" 98 // priority, e.g. with a hot dog menu badge. The experiment must have a 99 // probability_weight of 0. 100 KILL_BEST_EFFORT = 2; 101 102 // This is a kill-switch group that should be killed with "critical" 103 // priority. Depending on platform this may result in showing a 104 // non-dismissible restart prompt with a timer. This should only be used 105 // in very serious emergency circumstances. The experiment must have a 106 // probability_weight of 0. 107 KILL_CRITICAL = 3; 108 } 109 optional Type type = 7 [default = NORMAL]; 110 } 111 112 // List of experiments in this study. This list should include the default / 113 // control experiment. 114 // 115 // For example, to specify that 99% of users get the default behavior, while 116 // 0.5% of users get experience "A" and 0.5% of users get experience "B", 117 // specify the values below. 118 // Ex: { "default": 990, "A": 5, "B": 5 } 119 repeated Experiment experiment = 9; 120 121 // Possible Chrome release channels. 122 // See: http://dev.chromium.org/getting-involved/dev-channel 123 enum Channel { 124 // UNKNOWN value is defined here for the benefit of code using this enum 125 // type, but is not actually meant to be encoded in the protobuf. 126 UNKNOWN = -1; 127 CANARY = 0; 128 DEV = 1; 129 BETA = 2; 130 STABLE = 3; 131 } 132 133 // Possible Chrome operating system platforms. 134 enum Platform { 135 PLATFORM_WINDOWS = 0; 136 PLATFORM_MAC = 1; 137 PLATFORM_LINUX = 2; 138 PLATFORM_CHROMEOS = 3; 139 PLATFORM_ANDROID = 4; 140 PLATFORM_IOS = 5; 141 } 142 143 // Possible form factors Chrome is running on. 144 enum FormFactor { 145 DESKTOP = 0; 146 PHONE = 1; 147 TABLET = 2; 148 } 149 150 // Filtering criteria specifying whether this study is applicable to a given 151 // Chrome instance. 152 // 153 // Next tag: 10 154 message Filter { 155 // The start date of the study in Unix time format. (Seconds since midnight 156 // January 1, 1970 UTC). See: http://en.wikipedia.org/wiki/Unix_time 157 // Ex: 1330893974 (corresponds to 2012-03-04 20:46:14Z) 158 optional int64 start_date = 1; 159 160 // The minimum Chrome version for this study, allowing a trailing '*' 161 // character for pattern matching. Inclusive. (To check for a match, iterate 162 // over each component checking >= until a * or end of string is reached.) 163 // Optional - if not specified, there is no minimum version. 164 // Ex: "17.0.963.46", "17.0.963.*", "17.*" 165 optional string min_version = 2; 166 167 // The maximum Chrome version for this study; same formatting as 168 // |min_version| above. Inclusive. (To check for a match, iterate over each 169 // component checking <= until a * or end of string is reached.) 170 // Optional - if not specified, there is no maximum version. 171 // Ex: "19.*" 172 optional string max_version = 3; 173 174 // List of channels that will receive this study. If omitted, the study 175 // applies to all channels. 176 // Ex: [BETA, STABLE] 177 repeated Channel channel = 4; 178 179 // List of platforms that will receive this study. If omitted, the study 180 // applies to all platforms. 181 // Ex: [PLATFORM_WINDOWS, PLATFORM_MAC] 182 repeated Platform platform = 5; 183 184 // List of locales that will receive this study. If omitted, the study 185 // applies to all locales. 186 // Ex: ["en-US", "en-CA"] 187 repeated string locale = 6; 188 189 // List of form factors that will receive this study. If omitted, the study 190 // applies to all form factors. 191 // Ex: [PHONE, TABLET] 192 repeated FormFactor form_factor = 7; 193 194 // List of ChromeOS hardware classes that will receive this study. Each 195 // entry is treated as a substring of the actual device hardware_class, 196 // so "FOO" will match the client's hardware class "Device FOOBAR". If 197 // omitted, the study applies to all hardware classes unless 198 // |exclude_hardware_class| is specified. Mutually exclusive with 199 // |exclude_hardware_class|. 200 repeated string hardware_class = 8; 201 202 // List of ChromeOS hardware classes that will be excluded in this 203 // study. Each entry is treated as a substring of the actual device 204 // hardware_class, so "FOO" will match the client's hardware class 205 // "Device FOOBAR". If omitted, the study applies to all hardware classes 206 // unless |hardware_class| is specified. Mutually exclusive with 207 // |hardware_class|. 208 repeated string exclude_hardware_class = 9; 209 } 210 211 // Filtering criteria for this study. A study that is filtered out for a given 212 // client is equivalent to that study not being sent at all. 213 optional Filter filter = 10; 214 215 // Randomization seed to be used when |consistency| is set to PERMANENT. If 216 // not specified, randomization will be done using the trial name. 217 optional uint32 randomization_seed = 11; 218 219 // Specifies whether the study starts as active initially, or whether it 220 // requires the client to query its state before it is marked as active. 221 enum ActivationType { 222 // The study will be activated when its state is queried by the client. 223 // This is recommended for most studies that include client code. 224 ACTIVATION_EXPLICIT = 0; 225 // The study will be automatically activated when it is created. This 226 // is recommended for studies that do not have any client logic. 227 ACTIVATION_AUTO = 1; 228 } 229 230 // Activation type for this study. Defaults to ACTIVATION_EXPLICIT if omitted. 231 optional ActivationType activation_type = 12; 232} 233