ShrimpTest Model class
Implements the default ShrimpTest "Model". "Model" is model in the MVC sense, so it essentially is used to access the experiment store.
Located in /classes/model.php (line 16)
Prefix for all ShrimpTest database tables.
Includes $wpdb->prefix
Array of registered metric types and their arguments
Reference to the global ShrimpTest instance
Timeout value, in seconds, for experiment stats cache.
By default, 60 minutes (3600). Updatable via the shrimptest_stats_timeout filter. Also the timeout used to setup the stats-generating WP Cron process.
A prefix for the experiment stats transient name
By default, 'shrimptest_stats_'. Updatable via the shrimptest_stats_transient filter.
Array of registered variant types and their arguments
Dummy constructor
Hint: run init()
Delete the specified experiment, if the status will allow.
INDIVIDUAL EXPERIMENT FUNCTIONS
Will delete data not only from the experiments data, but will also delete associated data from other tables.
Delete an experiment variant
EXPERIMENT VARIANT FUNCTIONS
Return a "display-friendly" string of a given metric value, based on the metric that it is.
For example, if the metric is counting currency, the function may take 5 and return '$5'.
Get an array of active experiments
AGGREGATE EXPERIMENT FUNCTIONS
Get an experiment's specification
INDIVIDUAL EXPERIMENT FUNCTIONS
Returns all the data from the experiments table, with the "data" column, if available, unserialized into an array. All associated variants from the experiments_variants table will also be put in the "variants" entry as an array.
Get an array of experiments, using the parameters provided.
AGGREGATE EXPERIMENT FUNCTIONS
Possible parameters:
Get the computed stats for the specified experiment
INDIVIDUAL EXPERIMENT FUNCTIONS
Will try to pull the stats from the stats cache (which uses the WordPress Transients API), but will recreate it if it has expired or if $force is set.
The return value is organized as follows: for an experiment with X variants, there will be X+2 entries. Entries 0..(X-1) will have statistics for each of the variants. There is also an entry called "total". The variant and total statistics entries are themselves arrays, with the following entries:
Finally, the return value also has a "stats" entry which contains the following properties:
If the experiment specification specified an experiment duration, and it has been met with this experiment stats computation, the action shrimptest_experiment_duration_reached will be triggered, and the duration_reached property will be added to the experiment data.
Get the status string for the specified experiment.
INDIVIDUAL EXPERIMENT FUNCTIONS
Get a particular experiment variant and its specification
EXPERIMENT VARIANT FUNCTIONS
Get a list of variants for the given experiment
EXPERIMENT VARIANT FUNCTIONS
Get an array of metric type objects with some basic metadata, for editing.
Used by the ShrimpTest UI, so metrics which are _programmatic will be disabled, unless they are turned on, for example.
Get a reserved experiment id
INDIVIDUAL EXPERIMENT FUNCTIONS
This is used to create a new "reserved" experiment and return that experiment id. This can then be used to take the user to the "add new experiment" screen.
Get an array of variant type objects with some basic metadata, for editing.
Used by the ShrimpTest UI, so variants which are _programmatic will be disabled, unless they are turned on, for example.
Get the variant specification for the given experiment and visitor so that we can use it
Implements a normal culmulative distribution function (CDF), the integral of the probability density function.
HELPER FUNCTIONS
$type can be 'worse', 'better', or 'different'.
Sort by "defaultness"
HELPER FUNCTIONS
A sorting function which will prefer to order objects which have the _default property further forward.
Update an experiment's specification
INDIVIDUAL EXPERIMENT FUNCTIONS
Update the experiments table's entry for the given experiment id, putting some pre-specified parameters into columns, and everything else gets serialized into the "data" column. Information on variants and a new status string can also be specified in the experiment data, but will simply be passed on to update_experiment_variants() and update_experiment_status()
The given experiment data is first merged with the current experiment data so that no data is lost, using array_replace_recursive().
Update the specified experiment's status code.
INDIVIDUAL EXPERIMENT FUNCTIONS
Will set the start_time when setting to "active", and the end_time when setting to "finished".
Update an experiment variant
EXPERIMENT VARIANT FUNCTIONS
Update multiple variants of an experiment
EXPERIMENT VARIANT FUNCTIONS
Update the variant type of the specified experiment
INDIVIDUAL EXPERIMENT FUNCTIONS
Update a metric value for the given visitor
Take an associated array with numerical values and returns a weighted-random key
HELPER FUNCTIONS
Compute a z-score based on the control's stats and the variant's stats
HELPER FUNCTIONS
Documentation generated on Sat, 04 Sep 2010 23:40:57 -0400 by phpDocumentor 1.4.3