Property | Type | Description | |
---|---|---|---|
$assignment | |||
$in_experiment | |||
$inputs | |||
$logger_configured | |||
$name | |||
$salt |
Method | Description | |
---|---|---|
__construct ( mixed $inputs ) | Set up attributes needed for experiment | |
__toString ( ) : string | JSON representation of exposure log data - triggers exposure log | |
assign ( |
Add parameters used in experiment to current assignment | |
exposureLogged ( ) : boolean | See whether the experiment has already been exposure logged | |
get ( string $name, string $default = null ) : the | Get the value of a given experiment parameter - triggers exposure log | |
getParams ( ) : array | Get all experiment parameters - triggers exposure log. In general, this should only be used by custom loggers | |
inExperiment ( ) : boolean | In-experiment accessor | |
logEvent ( string $eventType, array $extras = null ) | Log an arbitrary event | |
logExposure ( array $extras = null ) | Logs exposure to treatment | |
name ( ) : string | Experiment name accessor | |
salt ( ) : string | Experiment-level salt accessor | |
setAutoExposureLogging ( boolean $value ) | Disables / enables auto exposure logging (enabled by default) | |
setExposureLogged ( boolean $value ) | Set whether the experiment has been exposure logged | |
setInExperiment ( boolean $value ) | In-experiment setter | |
setName ( string $value ) | Experiment name setter | |
setOverrides ( array $overrides ) | Sets variables that are to remain fixed during execution. Note that setting this will overwrite inputs to the experiment | |
setSalt ( string $value ) | Experiment-level salt setter | |
setup ( ) | * Optionally set experiment attributes before run, e.g. name and salt |
Method | Description | |
---|---|---|
_asBlob ( array $extras = [] ) : array | Get an array representation of the experiment data | |
_configureLogger ( ) | Set up files, database connections, sockets, etc for logging | |
_log ( array $data ) | Log experiment data | |
_previouslyLogged ( ) : boolean | Check if the input has already been logged. Gets called once in the constructor | |
_requiresExposureLogging ( ) | Checks if experiment requires exposure logging, and if so exposure logs |
Method | Description | |
---|---|---|
_assignSetup ( ) | Assignment and setup that happens when we need to log data | |
_requiresAssignment ( ) | Checks if an assignment has been made, assigns one if not |
public __construct ( mixed $inputs ) | ||
$inputs | mixed | input value or array to determine parameter assignments, e.g. userid |
public __toString ( ) : string | ||
return | string | JSON representation of exposure log data |
abstract protected _configureLogger ( ) |
abstract protected _previouslyLogged ( ) : boolean | ||
return | boolean | true if previously logged, false otherwise |
protected _requiresExposureLogging ( ) |
public exposureLogged ( ) : boolean | ||
return | boolean | true if exposure logged, false otherwise |
public inExperiment ( ) : boolean | ||
return | boolean | true if currently in experiment, false otherwise |
public logExposure ( array $extras = null ) | ||
$extras | array | optional extra data to include in exposure log |
public setAutoExposureLogging ( boolean $value ) | ||
$value | boolean | true to enable, false to disable |
public setExposureLogged ( boolean $value ) | ||
$value | boolean | true if exposure logged, false otherwise |
public setInExperiment ( boolean $value ) | ||
$value | boolean | true if currently in experiment, false otherwise |
public setOverrides ( array $overrides ) | ||
$overrides | array | parameter name/value pairs to use as overrides |
public setup ( ) |