Page Speed Optimization Libraries
1.9.32.2
|
#include "rewrite_options.h"
Public Member Functions | |
ExperimentSpec (const StringPiece &spec, const RewriteOptions *options, MessageHandler *handler) | |
ExperimentSpec (int id) | |
virtual ExperimentSpec * | Clone () |
Return a ExperimentSpec with all the same information as this one. | |
bool | is_valid () const |
int | id () const |
Accessors. | |
int | percent () const |
GoogleString | ga_id () const |
int | slot () const |
RewriteLevel | rewrite_level () const |
FilterSet | enabled_filters () const |
FilterSet | disabled_filters () const |
OptionSet | filter_options () const |
bool | matches_device_type (UserAgentMatcher::DeviceType type) const |
bool | use_default () const |
GoogleString | ToString () const |
Protected Types | |
typedef std::bitset < net_instaweb::UserAgentMatcher::kEndOfDeviceType > | DeviceTypeBitSet |
Protected Member Functions | |
void | Merge (const ExperimentSpec &spec) |
Static Protected Member Functions | |
static bool | ParseDeviceTypeBitSet (const StringPiece &in, DeviceTypeBitSet *out, MessageHandler *handler) |
This class is a separate subset of options for running an experiment. These options can be specified by a spec string that looks like: "id=<number greater than 0>;level=<rewrite level>="">;enabled= <comma-separated-list of filters to enable>;disabled= <comma-separated-list of filters to disable>;options= <comma-separated-list of option=value pairs to set>.
net_instaweb::RewriteOptions::ExperimentSpec::ExperimentSpec | ( | const StringPiece & | spec, |
const RewriteOptions * | options, | ||
MessageHandler * | handler | ||
) |
Creates a ExperimentSpec parsed from spec. If spec doesn't have an id, then id_ will be set to experiment::kExperimentNotSet. These ExperimentSpecs will then be rejected by AddExperimentSpec().
|
explicit |
Creates a ExperimentSpec with id_=id. All other variables are initialized to 0. This is primarily used for setting up the control and for cloning.
|
protected |
Merges a spec into this. This follows the same semantics as RewriteOptions. Specifically, filter/options list get unioned, and vars get overwritten, except ID. In the event of a conflict, e.g. preserve vs extend_cache, *this will take precedence.